[Baypiggies] Major improvements to XML/XHTML handling in Pycopia

Matt Good matt at matt-good.net
Fri Jun 22 00:14:43 CEST 2007

On Jun 20, 2007, at 2:57 AM, Keith Dart wrote:

> This shows basic page rendering times. Mako and Django are templating
> systems so parts of the page are static. Genshi, PyNMS, and Pycopia
> are purely dynamic, pure Python page generators.

Well, Genshi is a templating system too.  I take it you're using the  
builder API[1] and not the Genshi template language.

> However, the Pycopia
> and PyNMS generators also do on-the-fly attribute validation of the
> page. Pycopia is now almost twice as fast as Genshi, and more
> featureful also.  For example, only Pycopia can generate correct WML
> pages in pure Python.

So what's wrong with the Genshi WML output?  The Genshi builder API  
may not be as powerful since it's generally just been used to make  
small snippets to include in Genshi templates.  For example in Trac  
plugins use it to generate links for the menu bar, but most HTML  
content is in the template files.

I haven't had a need for on-the-fly validation, but it shouldn't be  
hard to write a Genshi filter to do it.

Since there are still no docs (hint, hint) it's hard to know exactly  
how Pycopia compares, but it might be more meaningful to compare it  
to Stan or Breve which are also meant to be pure-Python XML  
generators, while Genshi is more focused on templating.

It's probably also worth noting that Genshi supports HTML 4.01 output  
in addition to XML and XHTML.

-- Matt

[1] http://genshi.edgewall.org/wiki/ApiDocs/genshi.builder

More information about the Baypiggies mailing list