Top "Elementtree" questions

ElementTree is a Python library for creating and parsing XML.

Parsing XML in Python using ElementTree example

I'm having a hard time finding a good, basic example of how to parse XML in python using Element Tree. …

python xml elementtree
Convert Python ElementTree to string

Whenever I call ElementTree.tostring(e), I get the following error message: AttributeError: 'Element' object has no attribute 'getroot' Is …

python xml marshalling elementtree
Parsing XML with namespace in Python via 'ElementTree'

I have the following XML which I want to parse using Python's ElementTree: <rdf:RDF xml:base="http://dbpedia.…

python xml xml-parsing xml-namespaces elementtree
ParseError: not well-formed (invalid token) using cElementTree

I receive xml strings from an external source that can contains unsanitized user contributed content. The following xml string gave …

python parsing elementtree
Use xml.etree.ElementTree to print nicely formatted xml files

I am trying to use xml.etree.ElementTree to write out xml files with Python. The issue is that they …

python xml elementtree
How to extract xml attribute using Python ElementTree

For: <foo> <bar key="value">text</bar> </foo> How do I get "…

python xml xpath elementtree
How do I get Python's ElementTree to pretty print to an XML file?

Background I am using SQLite to access a database and retrieve the desired information. I'm using ElementTree in Python version 2.6 …

python xml python-2.6 elementtree pretty-print
How to get all sub-elements of an element tree with Python ElementTree?

I want to find a way to get all the sub-elements of an element tree like the way ElementTree.getchildren() …

python xml elementtree
How to write XML declaration using xml.etree.ElementTree

I am generating an XML document in Python using an ElementTree, but the tostring function doesn't include an XML declaration …

python xml elementtree