Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
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.
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
After an official release of a new stable series, bug fixes may become available at http://codespeak.net/svn/lxml/branch/lxml-2.2 . Running easy_install lxml==2.2bugfix will install the unreleased branch state from http://codespeak.net/svn/lxml/branch/lxml-2.2#egg=lxml-2.2bugfix as soon as a maintenance branch has been established.
- The resolve_entities option did not work in the incremental feed parser.
- Looking up and deleting attributes without a namespace could hit a namespaced attribute of the same name instead.
- Late errors during calls to SubElement() (e.g. attribute related ones) could leave a partially initialised element in the tree.
- Modifying trees that contain parsed entity references could result in an infinite loop.
- ObjectifiedElement.__setattr__ created an empty-string child element when the attribute value was rejected as a non-unicode/non-ascii string
- Syntax errors in lxml.cssselect could result in misleading error messages.
- Invalid syntax in CSS expressions could lead to an infinite loop in the parser of lxml.cssselect.
- CSS special character escapes were not properly handled in lxml.cssselect.
- CSS Unicode escapes were not properly decoded in lxml.cssselect.
- Select options in HTML forms that had no explicit value attribute were not handled correctly. The HTML standard dictates that their value is defined by their text content. This is now supported by lxml.html.
- XPath raised a TypeError when finding CDATA sections. This is now fully supported.
- Calling help(lxml.objectify) didn’t work at the prompt.
- The ElementMaker in lxml.objectify no longer defines the default namespaces when annotation is disabled.
- Feed parser failed to honour the ‘recover’ option on parse errors.
- Diverting the error logging to Python’s logging system was broken.