python bindings for RapidXml, a C++ XML parsing library
Project description
python_rapidxml
===============
A library providing python bindings for rapidxml
Example
---------------
import rapidxml
r = rapidxml.RapidXml("<test/><test2>foo</test2><test></test>") # parsing from string
test = r.first_node("test") # get first node named test
test.name = "foo" # changing node's name to foo
r.first_node("test2").value = "bar" # changing node's value to bar
print(str(r)) # will output prettified string of the xml document
print(test) # also works for nodes
with open('dump.xml', 'w') as f:
f.write(str(r))
r = rapidxml.RapidXml("dump.xml", True) # loading from file
assert(str(r) == r.unparse(True)) # is always True
assert(repr(r) == r.unparse()) # also always True, returns flat version
Project Current State
===============
This project is currently under *heavy* development.
===============
A library providing python bindings for rapidxml
Example
---------------
import rapidxml
r = rapidxml.RapidXml("<test/><test2>foo</test2><test></test>") # parsing from string
test = r.first_node("test") # get first node named test
test.name = "foo" # changing node's name to foo
r.first_node("test2").value = "bar" # changing node's value to bar
print(str(r)) # will output prettified string of the xml document
print(test) # also works for nodes
with open('dump.xml', 'w') as f:
f.write(str(r))
r = rapidxml.RapidXml("dump.xml", True) # loading from file
assert(str(r) == r.unparse(True)) # is always True
assert(repr(r) == r.unparse()) # also always True, returns flat version
Project Current State
===============
This project is currently under *heavy* development.
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
RapidXml-1.0.3.tar.gz
(31.7 kB
view hashes)