Top "Elementtree" questions

ElementTree is a Python library for creating and parsing XML.

Python running out of memory parsing XML using cElementTree.iterparse

A simplified version of my XML parsing function is here: import xml.etree.cElementTree as ET def analyze(xml): it = …

python memory-management memory-leaks elementtree
lxml.etree, element.text doesn't return the entire text from an element

I scrapped some html via xpath, that I then converted into an etree. Something similar to this: <td> …

python xml lxml elementtree xml.etree
Python - Element Tree is removing the XML declaration

I'm writing some XML with element tree. I'm giving the code an empty template file that starts with the XML …

python xml elementtree
ElementTree element index look up

I'm using the xml.etree.ElementTree module to create an XML document with Python 3.1 from another structured document. What ElementTree …

python elementtree
ElementTree TypeError "write() argument must be str, not bytes" in Python3

Got a Problem with generating a .SVG File with Python3 and ElementTree. from xml.etree import ElementTree as et doc = …

python svg elementtree
Faithfully Preserve Comments in Parsed XML

I'd like to preserve comments as faithfully as possible while manipulating XML. I managed to preserve comments, but the contents …

python xml python-2.7 elementtree
Cannot write XML file with default namespace

I'm writing a Python script to update Visual Studio project files. They look like this: <?xml version="1.0" encoding="utf-8"?&…

python xml elementtree
Python ElementTree default namespace?

Is there a way to define the default/unprefixed namespace in python ElementTree? This doesn't seem to work... ns = {"":"http://…

python xml python-3.x namespaces elementtree
How to set ElementTree Element text field in the constructor

How do I set the text field of of ElementTree Element from its constructor? Or, in the code below, why …

python xml elementtree
Alter namespace prefixing with ElementTree in Python

By default, when you call ElementTree.parse(someXMLfile) the Python ElementTree library prefixes every parsed node with it's namespace URI …

python xml namespaces elementtree