Element class. References a document object and a libxml node.
By pointing to a Document instance, a reference is kept to _Document
as long as there is some pointer to a node in it.
|
__contains__(x,
y)
y in x |
|
|
|
|
|
|
|
__delitem__(x,
y)
del x[y] |
|
|
|
|
|
__getitem__(...)
Returns the subelement at the given position. |
|
|
|
|
|
|
|
|
|
__new__(T,
S,
...)
Returns:
a new object with type S, a subtype of T |
|
|
|
|
|
|
|
|
|
__setitem__(x,
i,
y)
x[i]=y |
|
|
|
|
|
_init(...)
Called after object initialisation. |
|
|
|
addnext(...)
Adds the element as a following sibling directly after this
element. |
|
|
|
addprevious(...)
Adds the element as a preceding sibling directly before this
element. |
|
|
|
append(...)
Adds a subelement to the end of this element. |
|
|
|
clear(...)
Resets an element. |
|
|
|
extend(...)
Extends the current children by the elements in the iterable. |
|
|
|
find(...)
Finds the first matching subelement, by tag name or path. |
|
|
|
findall(...)
Finds all matching subelements, by tag name or path. |
|
|
|
findtext(...)
Finds text for the first matching subelement, by tag name or
path. |
|
|
|
get(...)
Gets an element attribute. |
|
|
|
|
|
getiterator(...)
Iterate over all elements in the subtree in document order (depth
first pre-order), starting with this element. |
|
|
|
getnext(...)
Returns the following sibling of this element or None. |
|
|
|
getparent(...)
Returns the parent of this element or None for the root
element. |
|
|
|
getprevious(...)
Returns the preceding sibling of this element or None. |
|
|
|
getroottree(...)
Return an ElementTree for the root node of the document that
contains this element. |
|
|
|
index(...)
Find the position of the child within the parent. |
|
|
|
insert(...)
Inserts a subelement at the given position in this element |
|
|
|
items(...)
Gets element attributes, as a sequence. |
|
|
|
iter(...)
Iterate over all elements in the subtree in document order (depth
first pre-order), starting with this element. |
|
|
|
iterancestors(...)
Iterate over the ancestors of this element (from parent to
parent). |
|
|
|
iterchildren(...)
Iterate over the children of this element. |
|
|
|
iterdescendants(...)
Iterate over the descendants of this element in document
order. |
|
|
|
itersiblings(...)
Iterate over the following or preceding siblings of this
element. |
|
|
|
keys(...)
Gets a list of attribute names. |
|
|
|
makeelement(...)
Creates a new element associated with the same document. |
|
|
|
remove(...)
Removes a matching subelement. |
|
|
|
replace(...)
Replaces a subelement with the element passed as second
argument. |
|
|
|
set(...)
Sets an element attribute. |
|
|
|
values(...)
Gets element attribute values as a sequence of strings. |
|
|
|
xpath(...)
Evaluate an xpath expression using the element as context
node. |
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__init__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__str__
|