Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install z3c.etree

How to install z3c.etree

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install z3c.etree
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.9.2 Available View build log
Windows (64-bit)
0.9.2 Available View build log
Mac OS X (10.5+)
0.9.2 Available View build log
Linux (32-bit)
0.9.2 Available View build log
Linux (64-bit)
0.9.2 Available View build log
Depended by
Lastest release
version 0.9.2 on Jan 5th, 2011


z3c.etree provides some mechanisms (a common interface) for integrating any ElementTree engine with the Zope component architecture. This allows applications to look up a engine against this interface. As such this package does not implement the ElementTree API.

z3c.etree also provides a set of utilities that can be used to make testing XML output in doctests easier. This functionality can also be called from a python based unit test via the assertXMLEqual method.

>>> import z3c.etree
>>> import z3c.etree.testing
>>> engine = z3c.etree.testing.etreeSetup()

Here are some examples for how to use z3c.etree with your own code.

To generate a Element object with the tag DAV:getcontenttype all we have to do is:

>>> etree = z3c.etree.getEngine()
>>> elem = etree.Element("{DAV:}getcontenttype")
>>> elem #doctest:+ELLIPSIS
<Element ...>
>>> z3c.etree.testing.assertXMLEqual(etree.tostring(elem), """
...    <getcontenttype xmlns="DAV:"/>""")

Now to add a value this element use just use the elem variable has the API suggests.

>>> elem.text = "text/plain"
>>> z3c.etree.testing.assertXMLEqual(etree.tostring(elem), """
...    <getcontenttype xmlns="DAV:">text/plain</getcontenttype>""")
>>> z3c.etree.testing.etreeTearDown()

Changes in z3c.etree

  • Bug: Fix Python 2.5 support.
  • Bug: Declared z3c as a namespace.
  • Implemented a way of comparing two XML fragments while ignoring the

System Message: WARNING/2 (<string>, line 58)

Bullet list ends without a blank line; unexpected unindent.

ordering of elements at the same level.

  • Allow the use of NORMALIZE_WHITESPACE with tag contents.
  • fix bug in getting access to the elementree engine
  • Start registering the elmenttree modules directly instead of using some

System Message: WARNING/2 (<string>, line 71)

Bullet list ends without a blank line; unexpected unindent.

proxy objects.

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.