Each XML element is represented by an instance of the
See Section 9.1, “Attributes of an
Element instance” for
attributes of an
Element instance in the
Python sense, as opposed to XML
See Section 9.2, “Accessing the list of child elements” for the various ways to access the element children of an element.
The various methods on
follow in alphabetical order, starting with Section 9.3, “
Element.append(): Add a new element
Each instance of the
Element class has
A dictionary containing the element's attributes. The keys are the attribute names, and each corresponding value is the attribute's value.
The base URI from an
attribute that this element contains or inherits,
The namespace prefix of this element, if any,
The line number of this element when parsed, if
The element's name.
The text following this element's closing tag, up
to the start tag of the next sibling element. If
there was no text there, this attribute will have
This way of associating text with elements is not
really typical of the way most XML processing
models work; see Section 2, “How
ElementTree represents XML”.
The text inside the element, up to the start tag of
the first child element. If there was no text
there, this attribute will have the value