The elementtree.XMLTreeBuilder Module

Tools to build element trees from XML files.

Module Contents

FancyTreeBuilder(html=0) (class) [#]

(experimental) An alternate builder that supports manipulation of new elements.

For more information about this class, see The FancyTreeBuilder Class.

TreeBuilder (class) [#]

(obsolete) ElementTree builder for XML source data, based on the expat parser.

For more information about this class, see The TreeBuilder Class.

The FancyTreeBuilder Class

FancyTreeBuilder(html=0) (class) [#]

(experimental) An alternate builder that supports manipulation of new elements.

end(element) [#]

Hook method that's called when a new element has been closed. May access the namespaces attribute.

element
The new element.

start(element) [#]

Hook method that's called when a new element has been opened. May access the namespaces attribute.

element
The new element. The tag name and attributes are, set, but it has no children, and the text and tail attributes are still empty.

The TreeBuilder Class

TreeBuilder (class) [#]

(obsolete) ElementTree builder for XML source data, based on the expat parser.

This class is an alias for ElementTree.XMLTreeBuilder. New code should use that version instead.