[XML-SIG] lxml 2.0alpha2 released
stefan_ml at behnel.de
Sun Sep 16 00:44:40 CEST 2007
I just released lxml 2.0alpha2 to PyPI.
** What is lxml?
In short: lxml is the most feature-rich and easy-to-use library for working
with XML and HTML in the Python language.
lxml is a Pythonic binding for the libxml2 and libxslt libraries. It is unique
in that it combines the speed and feature completeness of these libraries with
the simplicity of a native Python API.
This release features a number of major API additions that follow the
ElementTree library and the future API changes in ElementTree 1.3. The main
new features are HTML serialisation support, a feed interface to the parsers,
a SAX-like target parser interface, and iterfind() as an iterator version of
findall(). All of these are currently more or less experimental, so feedback
is warmly welcome. The lxml mailing list is always open for discussion, not
only on the new features. The complete changelog is below.
* ET.write(), tostring() and tounicode() now accept a keyword argument
"method" that can be one of 'xml' (or None), 'html' or 'text' to
serialise as XML, HTML or plain text content.
* iterfind() method on Elements returns an iterator equivalent to
* itertext() method on Elements
* Setting a QName object as value of the .text property or as an
attribute will resolve its prefix in the respective context
* ElementTree-like parser target interface as described in
* ElementTree-like feed parser interface on XMLParser and HTMLParser
(feed() and close() methods)
* lxml failed to serialise namespace declarations of elements other than
the root node of a tree
* Race condition in XSLT where the resolver context leaked between
concurrent XSLT calls
* element.getiterator() returns a list, use element.iter() to retrieve
an iterator (ElementTree 1.3 compatible behaviour)
* Reimplemented objectify.E for better performance and improved
integration with objectify. Provides extended type support based on
* XSLT objects now support deep copying
* New makeSubElement() C-API function that allows creating a new
subelement straight with text, tail and attributes.
* XPath extension functions can now access the current context node
(context.context_node) and use a context dictionary
(context.eval_context) from the context provided in their first
* HTML tag soup parser based on BeautifulSoup in lxml.html.ElementSoup
* New module lxml.doctestcompare by Ian Bicking for writing simplified
doctests based on XML/HTML output. Use by importing lxml.usedoctest or
lxml.html.usedoctest from within a doctest.
* New module lxml.cssselect by Ian Bicking for selecting Elements with
* New package lxml.html written by Ian Bicking for advanced HTML
* Namespace class setup is now local to the ElementNamespaceClassLookup
instance and no longer global.
* Schematron validation (incomplete in libxml2)
* Additional stringify argument to objectify.PyType() takes a conversion
function to strings to support setting text values from arbitrary types.
* Entity support through an Entity factory and element classes. XML
parsers now have a resolve_entities keyword argument that can be set to
False to keep entities in the document.
* column field on error log entries to accompany the line field
* Error specific messages in XPath parsing and evaluation
NOTE: for evaluation errors, you will now get an XPathEvalError instead
of an XPathSyntaxError. To catch both, you can except on XPathError.
* The regular expression functions in XPath now support passing a node-set
instead of a string
* Extended type annotation in objectify: new xsiannotate() function
* EXSLT RegExp support in standard XPath (not only XSLT)
* lxml.etree did not check tag/attribute names
* The XML parser did not report undefined entities as error
* The text in exceptions raised by XML parsers, validators and XPath
evaluators now reports the first error that occurred instead of the last
* Passing '' as XPath namespace prefix did not raise an error
* Thread safety in XPath evaluators
* objectify.PyType for None is now called "NoneType"
* el.getiterator() renamed to el.iter(), following ElementTree 1.3 -
original name is still available as alias
* In the public C-API, findOrBuildNodeNs() was replaced by the more
* Major refactoring in XPath/XSLT extension function code
* Network access in parsers disabled by default
More information about the XML-SIG