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.0beta1 (2008-01-11)

Features added

  • Parse-time XML schema validation (schema parser keyword).

  • XPath string results of the text() function and attribute selection make their Element container accessible through a getparent() method. As a side-effect, they are now always unicode objects (even ASCII strings).

  • XSLT objects are usable in any thread - at the cost of a deep copy if they were not created in that thread.

  • Invalid entity names and character references will be rejected by the Entity() factory.

  • entity.text returns the textual representation of the entity, e.g. &.

Bugs fixed

  • XPath on ElementTrees could crash when selecting the virtual root node of the ElementTree.

  • Compilation --without-threading was buggy in alpha5/6.

Other changes

  • Minor performance tweaks for Element instantiation and subelement creation

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