lxml 1.1 and 1.0.4 released

Stefan Behnel stefan.behnel-n05pAM at web.de
Wed Sep 13 18:27:12 CEST 2006

Hi all,

I'm proud to announce the release of lxml 1.1, right after lxml 1.0.4.



lxml 1.1 is a major new release that introduces many new features compared to
the 1.0 series.

lxml 1.0.4 is a maintenance release for the stable 1.0 series.

For a quick introduction:

lxml is a Pythonic 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, much more.

Its goals are:

    * Pythonic API.
    * Documented.
    * FAST!
    * Use Python unicode strings in API.
    * Safe (no segfaults).
    * No manual memory management!
      (as opposed to the official libxml2 Python bindings)

The main improvements in the 1.1 series are:

* threading support
* XPath axis iteration
* iterparse() and iterwalk()
* configurable Element class lookup methods
* lxml.objectify - a data binding API on top of lxml.etree

The complete changelog is below.

lxml 1.1 has been tested in an alpha and beta version and received various bug
fixes before the final release. It is currently considered stable and ready
for production use, whereas the 1.0 series are considered rock-stable and may
still be the right thing to choose for more conservative environments.

Bug-fix releases and minor improvements to the 1.1 and 1.0 series will
continue to become available at need. That way, 1.1 will soon be considered as
stable as 1.0 to become its the main line successor.

Given the many helpful egg contributions we received for past releases, I hope
that 1.1 (and 1.0.4) will be as well supported in that regard to help in
further increasing our community.

Thanks to everyone who helped in getting 1.1 done, in getting bugs fixed and
helping others in using it.

Have fun,

*** Changes in 1.0.4:

1.0.4 (2006-09-09)
Features added

    * List-like Element.extend() method

Bugs fixed

    * Crash in tail handling in Element.replace()

*** Changes in 1.1:

1.1 (2006-09-13)

Features added

* Comments and processing instructions return '<!-- coment -->' and
  '<?pi-target content?>' for repr()

* Parsers are now the preferred (and default) place where element class lookup
  schemes should be registered.  Namespace lookup is no longer supported by

Bugs fixed

* filenames with local 8-bit encoding were not supported

* 1.1beta did not compile under Python 2.3

* ignore unknown 'pyval' attribute values in objectify

* objectify.ObjectifiedElement.addattr() failed to accept Elements and Lists

* objectify.ObjectPath.setattr() failed to accept Elements and Lists

1.1beta (2006-08-08)

Features added

* Support for Python 2.5 beta

* Unlock the GIL for deep copying documents and for XPath()

* New ``compact`` keyword argument for parsing read-only documents

* Support for parser options in iterparse()

* The ``namespace`` axis is supported in XPath and returns (prefix, URI)

* The XPath expression "/" now returns an empty list instead of raising an

* XML-Object API on top of lxml (lxml.objectify)

* Customizable Element class lookup:

  * different pre-implemented lookup mechanisms

  * support for externally provided lookup functions

* Support for processing instructions (ET-like, not compatible)

* Public C-level API for independent extension modules

Bugs fixed

* XPathSyntaxError now inherits from XPathError

* Threading race conditions in RelaxNG and XMLSchema

* Crash when mixing elements from XSLT results into other trees, concurrent
  XSLT is only allowed when the stylesheet was parsed in the main thread

* The EXSLT ``regexp:match`` function now works as defined (except for some
  differences in the regular expression syntax)

* Setting element.text to '' returned None on request, not the empty string

* ``iterparse()`` could crash on long XML files

* Creating documents no longer copies the parser for later URL resolving.  For
  performance reasons, only a reference is kept.  Resolver updates on the
  parser will now be reflected by documents that were parsed before the
  change.  Although this should rarely become visible, it is a behavioral
  change from 1.0.

1.1alpha (2006-06-27)

Features added

* Module level ``iterwalk()`` function as 'iterparse' for trees

* Module level ``iterparse()`` function similar to ElementTree (see
  documentation for differences)

* Element.nsmap property returns a mapping of all namespace prefixes known at
  the Element to their namespace URI

* Reentrant threading support in RelaxNG, XMLSchema and XSLT

* Threading support in parsers and serializers:

  * All in-memory operations (tostring, parse(StringIO), etc.) free the GIL

  * File operations (on file names) free the GIL

  * Reading from file-like objects frees the GIL and reacquires it for reading

  * Serialisation to file-like objects is single-threaded (high lock overhead)

* Element iteration over XPath axes:

  * Element.iterdescendants() iterates over the descendants of an element

  * Element.iterancestors() iterates over the ancestors of an element (from
    parent to parent)

  * Element.itersiblings() iterates over either the following or preceding
    siblings of an element

  * Element.iterchildren() iterates over the children of an element in either

  * All iterators support the ``tag`` keyword argument to restrict the
    generated elements

* Element.getnext() and Element.getprevious() return the direct siblings of an
lxml-dev mailing list
lxml-dev at codespeak.net

More information about the Python-announce-list mailing list