Home | Trees | Index | Help |
|
---|
Class _Element |
|
object
--+
|
_Element
ElementBase
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.Method Summary | |
---|---|
x.__contains__(y) <==> y in x | |
__copy__(...)
| |
__deepcopy__(...)
| |
x.__delitem__(y) <==> del x[y] | |
Use of negative indices is not supported. | |
x.__getitem__(y) <==> x[y] | |
Use of negative indices is not supported. | |
x.__iter__() <==> iter(x) | |
x.__len__() <==> len(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
x.__nonzero__() <==> x != 0 | |
x.__repr__() <==> repr(x) | |
__reversed__(...)
| |
x.__setitem__(i, y) <==> x[i]=y | |
Use of negative indices is not supported. | |
Called after object initialisation. | |
Adds the element as a following sibling directly after this element. | |
Adds the element as a preceding sibling directly before this element. | |
Adds a subelement to the end of this element. | |
Resets an element. | |
Extends the current children by the elements in the iterable. | |
Finds the first matching subelement, by tag name or path. | |
Finds all matching subelements, by tag name or path. | |
Finds text for the first matching subelement, by tag name or path. | |
Gets an element attribute. | |
Returns all subelements. | |
Iterate over all elements in the subtree in document order (depth first pre-order), starting with this element. | |
Returns the following sibling of this element or None. | |
Returns the parent of this element or None for the root element. | |
Returns the preceding sibling of this element or None. | |
Return an ElementTree for the root node of the document that contains this element. | |
Find the position of the child within the parent. | |
Inserts a subelement at the given position in this element | |
Gets element attributes, as a sequence. | |
Iterate over all elements in the subtree in document order (depth first pre-order), starting with this element. | |
Iterate over the ancestors of this element (from parent to parent). | |
Iterate over the children of this element. | |
Iterate over the descendants of this element in document order. | |
Iterate over the following or preceding siblings of this element. | |
Gets a list of attribute names. | |
Creates a new element associated with the same document. | |
Removes a matching subelement. | |
Replaces a subelement with the element passed as second argument. | |
Sets an element attribute. | |
Gets element attribute values as a sequence of strings. | |
Evaluate an xpath expression using the element as context node. | |
Inherited from object | |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Class Variable Summary | |
---|---|
getset_descriptor |
attrib = <attribute 'attrib' of 'src.lxml.etree._Element...
|
getset_descriptor |
nsmap = <attribute 'nsmap' of 'src.lxml.etree._Element' ...
|
getset_descriptor |
prefix = <attribute 'prefix' of 'src.lxml.etree._Element...
|
getset_descriptor |
sourceline = <attribute 'sourceline' of 'src.lxml.etree....
|
getset_descriptor |
tag = <attribute 'tag' of 'src.lxml.etree._Element' obje...
|
getset_descriptor |
tail = <attribute 'tail' of 'src.lxml.etree._Element' ob...
|
getset_descriptor |
text = <attribute 'text' of 'src.lxml.etree._Element' ob...
|
Method Details |
---|
__contains__(x,
y)
x.__contains__(y) <==> y in x
|
__delitem__(x,
y)
x.__delitem__(y) <==> del x[y]
|
__delslice__(x,
i,
j)
Use of negative indices is not supported.
|
__getitem__(x,
y)
x.__getitem__(y) <==> x[y]
|
__getslice__(x,
i,
j)
Use of negative indices is not supported.
|
__iter__(x)x.__iter__() <==> iter(x)
|
__len__(x)
x.__len__() <==> len(x)
|
__new__(T, S, ...)T.__new__(S, ...) -> a new object with type S, a subtype of T
|
__nonzero__(x)
x.__nonzero__() <==> x != 0
|
__repr__(x)
x.__repr__() <==> repr(x)
|
__setitem__(x,
i,
y)
x.__setitem__(i, y) <==> x[i]=y
|
__setslice__(x,
i,
j,
y)
Use of negative indices is not supported.
|
_init(...)Called after object initialisation. Custom subclasses may override this if they recursively call _init() in the superclasses. |
addnext(...)Adds the element as a following sibling directly after this element. This is normally used to set a processing instruction or comment after the root node of a document. Note that tail text is automatically discarded when adding at the root level. |
addprevious(...)Adds the element as a preceding sibling directly before this element. This is normally used to set a processing instruction or comment before the root node of a document. Note that tail text is automatically discarded when adding at the root level. |
append(...)Adds a subelement to the end of this element. |
clear(...)Resets an element. This function removes all subelements, clears all attributes and sets the text and tail attributes to None. |
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. |
getchildren(...)Returns all subelements. The elements are returned in document order. |
getiterator(...)Iterate over all elements in the subtree in document order (depth first pre-order), starting with this element. Can be restricted to find only elements with a specific tag or from a namespace. You can also pass the Element, Comment, ProcessingInstruction and Entity factory functions to look only for the specific element type. Note that this method is deprecated in favour of the ``el.iter()`` method. In new code, use it only for backwards compatibility. |
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. This is the same as following element.getparent() up the tree until it returns None (for the root element) and then build an ElementTree for the last parent that was returned. |
index(...)Find the position of the child within the parent. This method is not part of the original ElementTree API. |
insert(...)Inserts a subelement at the given position in this element |
items(...)Gets element attributes, as a sequence. The attributes are returned in an arbitrary order. |
iter(...)Iterate over all elements in the subtree in document order (depth first pre-order), starting with this element. Can be restricted to find only elements with a specific tag or from a namespace. You can also pass the Element, Comment, ProcessingInstruction and Entity factory functions to look only for the specific element type. |
iterancestors(...)Iterate over the ancestors of this element (from parent to parent). The generated elements can be restricted to a specific tag name with the 'tag' keyword. |
iterchildren(...)Iterate over the children of this element. As opposed to using normal iteration on this element, the generated elements can be restricted to a specific tag name with the 'tag' keyword and reversed with the 'reversed' keyword. |
iterdescendants(...)Iterate over the descendants of this element in document order. As opposed to ``el.iter()``, this iterator does not yield the element itself. The generated elements can be restricted to a specific tag name with the 'tag' keyword. |
itersiblings(...)Iterate over the following or preceding siblings of this element. The direction is determined by the 'preceding' keyword which defaults to False, i.e. forward iteration over the following siblings. The generated elements can be restricted to a specific tag name with the 'tag' keyword. |
keys(...)Gets a list of attribute names. The names are returned in an arbitrary order (just like for an ordinary Python dictionary). |
makeelement(...)Creates a new element associated with the same document. |
remove(...)Removes a matching subelement. Unlike the find methods, this method compares elements based on identity, not on tag value or contents. |
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. The attributes are returned in an arbitrary order. |
xpath(...)Evaluate an xpath expression using the element as context node. |
Class Variable Details |
---|
attrib
|
nsmap
|
prefix
|
sourceline
|
tag
|
tail
|
text
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Jul 30 16:10:41 2007 | http://epydoc.sf.net |