class documentation
A wrapper around ElementTree Element objects whose main purpose is to provide nicer __repr__ and __str__ methods. In addition, any of the wrapped Element's methods that return other Element objects are overridden to wrap those values before returning them.
This makes Elements more convenient to work with in interactive sessions and doctests, at the expense of some efficiency.
Method | __delattr__ |
Undocumented |
Method | __delitem__ |
Undocumented |
Method | __delslice__ |
Undocumented |
Method | __getattr__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __getslice__ |
Undocumented |
Method | __init__ |
Initialize a new Element wrapper for etree. |
Method | __len__ |
Undocumented |
Method | __new__ |
Create and return a wrapper around a given Element object. If etree is an ElementWrapper, then etree is returned as-is. |
Method | __repr__ |
Undocumented |
Method | __setattr__ |
Undocumented |
Method | __setitem__ |
Undocumented |
Method | __setslice__ |
Undocumented |
Method | __str__ |
the wrapped Element object. |
Method | find |
Undocumented |
Method | findall |
Undocumented |
Method | getchildren |
Undocumented |
Method | getiterator |
Undocumented |
Method | makeelement |
Undocumented |
Method | unwrap |
Return the Element object wrapped by this wrapper. |
Initialize a new Element wrapper for etree.
If etree is a string, then it will be converted to an Element object using ElementTree.fromstring() first:
>>> ElementWrapper("<test></test>") <Element "<?xml version='1.0' encoding='utf8'?>\n<test />">
Create and return a wrapper around a given Element object. If etree is an ElementWrapper, then etree is returned as-is.