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

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.0alpha6.tar.gz (2.3 MB) Copy SHA256 hash SHA256 Source None Dec 19, 2007

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 DigiCert DigiCert EV certificate StatusPage StatusPage Status page