XML Parsing

Paul Boddie paul at boddie.net
Tue Feb 17 04:32:37 EST 2004


"James Kew" <james.kew at btinternet.com> wrote in message news:<c0rkhb$1ai18a$1 at ID-71831.news.uni-berlin.de>...
> 
> For raw speed, libxml2 (and its Python wrapper) seems to get a lot of
> glowing reviews. It's not a standard DOM API, though, and again
> documentation is a problem (lots of C-API-level documentation, but not much
> in terms of how to put it together into a working Python app).

I made a PyXML-style wrapper for libxml2, although it works above the
existing wrapper and therefore isn't very fast. However, if you just
want to access various parts of your documents before getting libxslt
to do the real work, you might find it convenient. Here it is:

  http://www.boddie.org.uk/python/downloads/libxml2dom-0.1.tar.gz

I also made a wrapper around qtxml/KHTML which gives the same
PyXML-style conveniences:

  http://www.boddie.org.uk/python/downloads/qtxmldom-0.1.tar.gz

Obviously, if you don't mind writing to a specific API, then neither
of these packages is the way to go. However, XML processing is quite
often a tradeoff between compliance, convenience and performance, as
the recent PyRXP debate demonstrates. ;-)

Paul



More information about the Python-list mailing list