__init__.py |
A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method which takes a tree as sole argument and
returns an iterator which generates tokens.
|
5719 |
base.py |
Walks a tree yielding tokens
Tokens are dicts that all have a ``type`` field specifying the type of the
token.
|
7476 |
dom.py |
|
1413 |
etree.py |
Given the particular ElementTree representation, this implementation,
to avoid using recursion, returns "nodes" as tuples with the following
content:
1. The current element
2. The index of the element relative to its parent
3. A stack of ancestor elements
4. A flag "text", "tail" or None to indicate if the current node is a
text node; either the text or tail of the current element (1)
|
4539 |
etree_lxml.py |
|
6345 |
genshi.py |
|
2309 |