[issue13275] Recommend xml.etree for XML processing

Terry J. Reedy report at bugs.python.org
Sat Oct 29 02:24:19 CEST 2011

Terry J. Reedy <tjreedy at udel.edu> added the comment:

In the tutorial, "The xml.dom and xml.sax packages" should be expanded to "The xml.dom, xml.sax, and xml.etree packages". I suspect that the current line predates the addition of .etree.

We try to mostly not give opinion-based recommendations; the docs are for facts. Some people recommend using lxml instead of any of the above ;-).

"The documentation for the xml.dom and xml.sax packages are the definition of the Python bindings for the DOM and SAX interfaces."

could be followed by a factual sentence like "xml.etree provides an  third alternative."

Looking more: the intro to 19.6. xml.dom — The Document Object Model API nicely explains the difference between SAX and DOM processing as sequential versus random access. The intro to 19.13. xml.etree.ElementTree — The ElementTree XML API says nothing about how it compares to the others. Perhaps the sentence should be "xml.etree provides a tree-based interface different from xml.dom." (assuming this is a fact). Make your suggestion.

nosy: +terry.reedy

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list