ZVON > References > DOM2 Reference

TreeWalker (interface )


Own properties:
attributes  -  currentNode, expandEntityReferences, filter, root, whatToShow
methods  -  firstChild, lastChild, nextNode, nextSibling, parentNode, previousNode, previousSibling

Description:
TreeWalker objects are used to navigate a document tree or subtree using the view of the document defined by their whatToShow flags and filter (if any). Any function which performs navigation using a TreeWalker will automatically support any view defined by a TreeWalker.
Omitting nodes from the logical view of a subtree can result in a structure that is substantially different from the same subtree in the complete, unfiltered document. Nodes that are siblings in the TreeWalker view may be children of different, widely separated nodes in the original view. For instance, consider a NodeFilter that skips all nodes except for Text nodes and the root node of a document. In the logical view that results, all text nodes will be siblings and appear as direct children of the root node, no matter how deeply nested the structure of the original document.