- lxml.sax.ElementTreeContentHandler checks closing elements and raises
SaxError on mismatch
- lxml.sax.ElementTreeContentHandler now supports namespace-less SAX events
(startElement, endElement) and defaults to empty attributes (keyword
argument)
- Speedup for repeatedly accessing element tag names
- Minor API performance improvements
- Memory deallocation bug when using XSLT output method "html"
- sax.py was handling UTF-8 encoded tag names where it shouldn't
- lxml.tests package will no longer be installed (is still in source tar)
- Error logging API for libxml2 error messages
- Various performance improvements
- Benchmark script for lxml, ElementTree and cElementTree
- Support for registering extension functions through new FunctionNamespace
class (see doc/extensions.txt)
- Support for variables in XPath expressions (also in XPath class)
- XPath class for compiled XPath expressions
- XMLID module level function
- XMLParser API for customized libxml2 parser configuration
- Support for custom Element classes through new Namespace API (see
doc/namespace_extensions.txt)
- Common exception base class LxmlError for module exceptions
- real iterator support in iter(Element), Element.getiterator()
- XSLT objects are callable, result trees support str()
- Added MANIFEST.in for easier creation of RPM files.
- 'getparent' method on elements allows navigation to an element's
parent element.
- Python core compatible SAX tree builder and SAX event generator. See
doc/sax.txt for more information.
- Segfaults and memory leaks in various API functions of Element
- Segfault in XSLT.tostring()
- ElementTree objects no longer interfere, Elements can be root of different
ElementTrees at the same time
- document('') now works in XSLT documents read from files (in-memory
documents cannot support this due to libxslt deficiencies)
- Support for copy.deepcopy() on elements. copy.copy() works also, but
does the same thing, and does not create a shallow copy, as that
makes no sense in the context of libxml2 trees. This means a
potential incompatibility with ElementTree, but there's more chance
that it works than if copy.copy() isn't supported at all.
- Increased compatibility with (c)ElementTree; .parse() on ElementTree is
now supported and parsing of gzipped XML files works.
- implemented index() on elements, allowing one to find the index of a
SubElement.
- Use xslt-config instead of xml2-config to find out libxml2
directories to take into account a case where libxslt is installed
in a different directory than libxslt.
- Eliminate crash condition in iteration when text nodes are changed.
- Passing 'None' to tostring() does not result in a segfault anymore,
but an AssertionError.
- Some test fixes for Windows.
- Raise XMLSyntaxError and XPathSyntaxError instead of plain python
syntax errors. This should be less confusing.
- Fixed error with uncaught exception in Pyrex code.
- Calling lxml.etree.fromstring('') now throws XMLSyntaxError instead
of a segfault.
- has_key() now works on attrib. 'in' tests also work correctly now on
attrib.
- INSTALL.txt was saying 2.2.16 instead of 2.6.16 as a supported
libxml2 version, as it should.
- Passing a UTF-8 encoded string to the XML() function would fail;
fixed.
- parameters (XPath expressions) can now be passed to XSLT using
keyword parameters.
- Simple XInclude support. Calling the xinclude() method on a tree
will process any XInclude statements in the document.
- XMLSchema support. Use the XMLSchema class or the convenience
xmlschema() method on a tree to do XML Schema (XSD) validation.
- Added convenience xslt() method on tree. This is less efficient
than the XSLT object, but makes it easier to write quick code.
- Added convenience relaxng() method on tree. This is less efficient
than the RelaxNG object, but makes it easier to write quick code.
- Make it possible to use XPathEvaluator with elements as well. The
XPathEvaluator in this case will retain the element so multiple
XPath queries can be made against one element efficiently. This
replaces the second argument to the .evaluate() method that existed
previously.
- Allow registerNamespace() to be called on an XPathEvaluator, after
creation, to add additional namespaces. Also allow registerNamespaces(),
which does the same for a namespace dictionary.
- Add 'prefix' attribute to element to be able to read prefix information.
This is entirely read-only.
- It is possible to supply an extra nsmap keyword parameter to
the Element() and SubElement() constructors, which supplies a
prefix to namespace URI mapping. This will create namespace
prefix declarations on these elements and these prefixes will show up
in XML serialization.
- Killed yet another memory management related bug: trees created
using newDoc would not get a libxml2-level dictionary, which caused
problems when deallocating these documents later if they contained a
node that came from a document with a dictionary.
- Moving namespaced elements between documents was problematic as
references to the original document would remain. This has been fixed
by applying xmlReconciliateNs() after each move operation.
- Can pass None to 'dump()' without segfaults.
- tostring() now works properly for non-root elements as well.
- Cleaned out the tostring() method so it should handle encoding
correctly.
- Cleaned out the ElementTree.write() method so it should handle
encoding correctly. Writing directly to a file should also be faster
now, as there is no need to go through a Python string in that
case. Made sure the test cases test both serializing to StringIO as
well as serializing to a real file.
- Changed setup.py so that library_dirs is also guessed. This should
help with compilation on the Mac OS X platform, where otherwise the
wrong library (shipping with the OS) could be picked up.
- Tweaked setup.py so that it picks up the version from version.txt.
- Do the right thing when handling namespaced attributes.
- fix bug where tostring() moved nodes into new documents. tostring()
had very nasty side-effects before this fix, sorry!
- Python 2.2 compatibility fixes.
- unicode fixes in Element() and Comment() as well as XML(); unicode
input wasn't properly being UTF-8 encoded.