Class ElementDepthFirstIterator
object --+
|
_ElementTagMatcher --+
|
ElementDepthFirstIterator
Iterates over an element and its sub-elements in document order (depth
first pre-order). Note that this also includes comments, entities and
processing instructions. To filter them out, check if the ``tag``
property of the returned element is a string (i.e. not None and not a
factory function).
If the optional 'tag' argument is not None, the iterator returns only
the elements that match the respective name and namespace.
The optional boolean argument 'inclusive' defaults to True and can be
set to False to exclude the start element itself.
Note that the behaviour of this iterator is completely undefined if
the tree it traverses is modified during iteration.
|
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature |
|
|
|
|
|
__new__(T,
S,
...)
Returns:
a new object with type S, a subtype of T |
|
|
|
|
|
next(x)
Returns:
the next value, or raise StopIteration |
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|
Inherited from object :
__class__
|
__init__(...)
(Constructor)
|
|
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature
- Overrides:
object.__init__
|
- Returns:
the next value, or raise StopIteration
|