Main XML Element class.
Element children are accessed as object attributes. Multiple children
with the same name are available through a list index. Example:
|
|
|
|
|
|
|
|
|
|
|
__getattr__(...)
Return the (first) child with the given tag name. |
|
|
|
|
|
|
|
__getitem__(...)
Return a sibling, counting from the first child of the parent. |
|
|
|
|
|
|
|
__iter__(...)
Iterate over self and all siblings with the same tag. |
|
|
|
|
|
|
|
__new__(T,
S,
...)
Returns:
a new object with type S, a subtype of T |
|
|
|
|
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value |
|
|
|
|
|
|
|
|
|
|
|
|
|
addattr(...)
Add a child value to the element. |
|
|
|
|
countchildren(...)
Return the number of children of this element, regardless of their
name. |
|
|
|
|
descendantpaths(...)
Returns a list of object path expressions for all descendants. |
|
|
|
|
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. |
|
|
|
Inherited from etree._Element:
__contains__,
__copy__,
__deepcopy__,
__nonzero__,
__repr__,
__reversed__,
addnext,
addprevious,
append,
clear,
extend,
get,
getchildren,
getiterator,
getnext,
getparent,
getprevious,
getroottree,
index,
insert,
items,
iter,
iterancestors,
iterchildren,
iterdescendants,
itersiblings,
keys,
makeelement,
remove,
replace,
set,
values,
xpath
Inherited from object:
__hash__,
__init__,
__reduce__,
__reduce_ex__
|