Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

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 https://launchpad.net/lxml

In case you want to use the current in-development version of lxml, you can get it from the subversion repository at http://codespeak.net/svn/lxml/trunk . Running easy_install lxml==dev will install it from http://codespeak.net/svn/lxml/trunk#egg=lxml-dev

2.1beta1 (2008-04-15)

Features added

  • Error logging in Schematron (requires libxml2 2.6.32 or later).
  • Parser option strip_cdata for normalising or keeping CDATA sections. Defaults to True as before, thus replacing CDATA sections by their text content.
  • CDATA() factory to wrap string content as CDATA section.

Bugs fixed

  • Resolving to a filename in custom resolvers didn’t work.
  • lxml did not honour libxslt’s second error state “STOPPED”, which let some XSLT errors pass silently.
  • Memory leak in Schematron with libxml2 >= 2.6.31.
  • lxml.etree accepted non well-formed namespace prefix names.

Other changes

  • Major cleanup in internal moveNodeToDocument() function, which takes care of namespace cleanup when moving elements between different namespace contexts.
  • New Elements created through the makeelement() method of an HTML parser or through lxml.html now end up in a new HTML document (doctype HTML 4.01 Transitional) instead of a generic XML document. This mostly impacts the serialisation and the availability of a DTD context.

Project details


Release history Release notifications

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
lxml-2.1beta1.tar.gz (2.1 MB) Copy SHA256 hash SHA256 Source None Apr 15, 2008

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page