lxml wrapper that simplifies xml generation code.
Project description
This wrapper simplifies your Python xml generation code.
Example XML:
<root attrib="10">
text
<child attrib="">
childtext
</child>
tail
</root>
New way:
E('root', attrib=10).add(
'text',
E('child', attrib=None).add(
'childtext'),
'tail')
Old way:
root = Element('root', attrib=str(10)) # cast to str
root.text = 'text'
child = SubElement(root, 'child', attrib=value or "") # change None to empty string
child.text = 'childtext'
child.tail = 'tail'
Example XML:
<root attrib="10">
text
<child attrib="">
childtext
</child>
tail
</root>
New way:
E('root', attrib=10).add(
'text',
E('child', attrib=None).add(
'childtext'),
'tail')
Old way:
root = Element('root', attrib=str(10)) # cast to str
root.text = 'text'
child = SubElement(root, 'child', attrib=value or "") # change None to empty string
child.text = 'childtext'
child.tail = 'tail'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lxml-wrapper-0.1b.tar.gz
(2.2 kB
view hashes)