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.
Metadata
Release files for z3c.etree 0.9.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| z3c.etree-0.9.2.tar.gz | 12.0 kB | Without provenance | Details for z3c.etree-0.9.2.tar.gz |
Release files / z3c.etree-0.9.2.tar.gz
| Download URL | z3c.etree-0.9.2.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2bc74352095267e2b8f30106b308c68589c57c44750d47bbb4905d85393cde83
|
|
BLAKE2b-256 checksum How to use checksums |
41ea8b17f5acf2196643632cc590b91e6e9c30318c0eb424fb10a971969363d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for z3c.etree 0.9.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.