Home | Trees | Index | Help |
---|
Package docutils :: Module nodes :: Class Node |
|
Element
Abstract base class of nodes in a document tree.
Method Summary | |
---|---|
Node instances are always true, even if they're empty. | |
Return a DOM fragment representation of this Node. | |
Return a copy of self. | |
Return a deep copy of self (also copying children). | |
Return the first node in the iterable returned by traverse(), or None if the iterable is empty. | |
Return an indented pseudo-XML representation, for test purposes. | |
setup_child(self,
child)
| |
Return an iterable containing | |
Traverse a tree of Node objects, calling the
dispatch_visit() method of visitor when entering each
node. | |
Perform a tree traversal similarly to Node.walk() (which
see), except also call the dispatch_departure() method
before exiting each node. |
Class Variable Summary | |
---|---|
NoneType |
document = None |
NoneType |
line = None |
NoneType |
parent = None |
NoneType |
source = None |
Method Details |
---|
__nonzero__(self)
|
asdom(self, dom=None)Return a DOM fragment representation of this Node. |
copy(self)Return a copy of self. |
deepcopy(self)Return a deep copy of self (also copying children). |
next_node(self, condition=None, include_self=0, descend=1, siblings=0, ascend=0)Return the first node in the iterable returned by traverse(), or None if the iterable is empty. Parameter list is the same as of traverse. Note that include_self defaults to 0, though. |
pformat(self, indent=' ', level=0)Return an indented pseudo-XML representation, for test purposes. Override in subclasses. |
traverse(self, condition=None, include_self=1, descend=1, siblings=0, ascend=0)Return an iterable containing
If If ascend is true, assume siblings to be true as well. For example, given the following tree: <paragraph> <emphasis> <--- emphasis.traverse() and <strong> <--- strong.traverse() are called. Foo Bar <reference name="Baz" refid="baz"> Baz Then list(emphasis.traverse()) equals [<emphasis>, <strong>, <#text: Foo>, <#text: Bar>] and list(strong.traverse(ascend=1)) equals [<strong>, <#text: Foo>, <#text: Bar>, <reference>, <#text: Baz>] |
walk(self, visitor)Traverse a tree of This tree traversal supports limited in-place tree modifications. Replacing one node with one or more nodes is OK, as is removing an element. However, if the node removed or replaced occurs after the current node, the old node will still be traversed, and any new nodes will not. Within visit methods (and depart methods for
Parameter |
walkabout(self, visitor)Perform a tree traversal similarly to Parameter |
Class Variable Details |
---|
document
|
line
|
parent
|
source
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Wed Jul 12 11:20:41 2006 | http://epydoc.sf.net |