This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
crudexml -- Crude XML DOM module

Simple and crude write-only XML DOM implementation.
It does not read XML data, only produces XML text from the node objects provided here.
Attributes are supported; namespaces are not.
Finally, it is possible to get a "pretty" output using the OuterXMLPretty getter property.

_node is a base class with most of the functionality, with node being the "general" node type and tnode for text nodes.
The intent is that these nodes have either node children or one tnode child.
This keeps things simpler.
Also, unlike Real DOM Implementations, the text node is a named node with text underneath it.

Example use:

from crudexml import node, tnode

root = node('dvd', numtitles=7, parser="pydvdread %s"%1.0)
root.AddChild( tnode('device', "/dev/sr0") )
root.AddChild( tnode('name', "BLOOD_DIAMOND", fancy="Blood Diamond") )
root.AddChild( tnode('vmg_id', "DVDVIDEO-VMG") )
root.AddChild( tnode('provider_id', "WARNER_HOME_VIDEO") )
titles = root.AddChild( node('titles') )

Attributes are passed as named keywords to node() and tnode(), and can be accessed by using [...] on node nbjects.
node.AddChild() returns the supplied node as with @titles above.
The OuterXMLPretty for the above produces:


<dvd numtitles="7" parser="pydvdread 1.0">
<device>/dev/sr0</device>
<name fancy="Blood Diamond">BLOOD_DIAMOND</name>
<vmg_id>DVDVIDEO-VMG</vmg_id>
<provider_id>WARNER_HOME_VIDEO</provider_id>
<titles/>
</dvd>

Additionally, the DOCTYPE is supported.

from crudexml import node, tnode, dnode, docroot

d = docroot()
d.AddChild( dnode('foo', 'bar.dtd') )

root = d.AddChild( node('dvd', numtitles=7, parser="pydvdread %s"%1.0) )
root.AddChild( tnode('device', "/dev/sr0") )
root.AddChild( tnode('name', "BLOOD_DIAMOND", fancy="Blood Diamond") )
root.AddChild( tnode('vmg_id', "DVDVIDEO-VMG") )
root.AddChild( tnode('provider_id', "WARNER_HOME_VIDEO") )
titles = root.AddChild( node('titles') )

And the XML:


SYSTEM 'bar.dtd'>
<dvd numtitles="7" parser="pydvdread 1.0">
<device>/dev/sr0</device>
<name fancy="Blood Diamond">BLOOD_DIAMOND</name>
<vmg_id>DVDVIDEO-VMG</vmg_id>
<provider_id>WARNER_HOME_VIDEO</provider_id>
<titles/>
</dvd>

The docroot() produces no XML for itself (i.e., OuterXML == InnerXML) and why the DOCTYPE and <dvd>...</dvd> are shown at the "root" level.
Release History

Release History

1.0

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

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
crudexml-1.0.tar.gz (3.2 kB) Copy SHA256 Checksum SHA256 Source Jan 6, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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