Skip to main content

Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.

Project description

lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It provides safe and convenient access to these libraries using the ElementTree API.

It extends the ElementTree API significantly to offer support for XPath, RelaxNG, XML Schema, XSLT, C14N and much more.

To contact the project, go to the project home page or see our bug tracker at

In case you want to use the current in-development version of lxml, you can get it from the subversion repository at . Running easy_install lxml==dev will install it from

2.0alpha6 (2007-12-19)

Features added

  • New properties position and code on ParseError exception (as in ET 1.3)

Bugs fixed

  • Memory leak in the parse() function.

  • Minor bugs in XSLT error message formatting.

  • Result document memory leak in target parser.

Other changes

  • Various places in the XPath, XSLT and iteration APIs now require keyword-only arguments.

  • The argument order in element.itersiblings() was changed to match the order used in all other iteration methods. The second argument (‘preceding’) is now a keyword-only argument.

  • The getiterator() method on Elements and ElementTrees was reverted to return an iterator as it did in lxml 1.x. The ET API specification allows it to return either a sequence or an iterator, and it traditionally returned a sequence in ET and an iterator in lxml. However, it is now deprecated in favour of the iter() method, which should be used in new code wherever possible.

  • The ‘pretty printed’ serialisation of ElementTree objects now inserts newlines at the root level between processing instructions, comments and the root tag.

  • A ‘pretty printed’ serialisation is now terminated with a newline.

  • Second argument to lxml.etree.Extension() helper is no longer required, third argument is now a keyword-only argument ns.

  • lxml.html.tostring takes an encoding argument.

Project details

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lxml-2.0alpha6.tar.gz (2.3 MB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page