This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Help us improve Python packaging - Donate today!
Project Description

z3c.etree

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.

Developers

>>> 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>""")

Tear-down

>>> z3c.etree.testing.etreeTearDown()

Changes in z3c.etree

0.9.2

  • Bug: Fix Python 2.5 support.
  • Bug: Declared z3c as a namespace.
  • Implemented a way of comparing two XML fragments while ignoring the ordering of elements at the same level.
  • Allow the use of NORMALIZE_WHITESPACE with tag contents.

0.9.1

  • fix bug in getting access to the elementree engine

0.9

  • Start registering the elmenttree modules directly instead of using some proxy objects.
Release History

Release History

0.9.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
z3c.etree-0.9.2.tar.gz (12.0 kB) Copy SHA256 Checksum SHA256 Source Feb 22, 2008

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting