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.2beta4 (2009-02-27)

Features added

  • Support strings and instantiable Element classes as child arguments to the constructor of custom Element classes.

  • GZip compression support for serialisation to files and file-like objects.

Bugs fixed

  • Deep-copying an ElementTree copied neither its sibling PIs and comments nor its internal/external DTD subsets.

  • Soupparser failed on broken attributes without values.

  • Crash in XSLT when overwriting an already defined attribute using xsl:attribute.

  • Crash bug in exception handling code under Python 3. This was due to a problem in Cython, not lxml itself.

  • lxml.html.FormElement._name() failed for non top-level forms.

  • TAG special attribute in constructor of custom Element classes was evaluated incorrectly.

Other changes

  • Official support for Python 3.0.1.

  • Element.findtext() now returns an empty string instead of None for Elements without text content.

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.2beta4.tar.gz (2.9 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