| | The Traversal module enables easier ways of walking through the document tree. It defines two new constructs - a NodeIterator
and a TreeWalker
. These both present a logical view of the tree, which may not have all the nodes in it which are actually in the document tree. The NodeIterator is a flat view of the tree, in which there is no parent/child relationship. Thus methods enable moving forward or backward in the list, but not up and down. The TreeWalker, in comparison, retains the hierarchy of the original tree, even though some nodes may be missing, and therefore has methods to move up and down in the tree as well as back and forth. |