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

Keith Dart keith at dartworks.biz
Wed Jun 20 11:57:57 CEST 2007

I've just completed a major overhaul of the XML/XHTML portions of
Pycopia. It now handles various encodings and languages much better,
and is also much faster. Some of the XHTML modules has been refactored
into the XML module.

The Mako benchmark shows about a 150% speed improvement in simple page

891 $ python basic.py mako django genshi Pycopia pyNMS
Mako: 0.45 ms
Django: 1.33 ms
Genshi: 5.24 ms
Pycopia: 2.69 ms
Pynms: 4.44 ms

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. 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.

It is now possible to do encoding translations. Fetch a document in
one encoding, and write it in another. For  example, read a shiftjis
and write a utf-8 page, or vice-versa (as long as the charset maps).

Support for all the major XHTML and WML flavors is also there,
including XHTML 1.1,  XHTML mobile 2.0, and WML 2.0. The parser does
partial validation of same when parsing (tag and attribute names), and
generating. The system is semantically idempotent.


-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Keith Dart <keith at dartworks.biz>
   public key: ID: 19017044

More information about the Baypiggies mailing list