org.apache.xml.utils
Class TreeWalker
java.lang.Object
org.apache.xml.utils.TreeWalker
public class TreeWalker
extends java.lang.Object
This class does a pre-order walk of the DOM tree, calling a ContentHandler
interface as it goes.
ContentHandler | getContentHandler() - Get the ContentHandler used for the tree walk.
|
void | setContentHandler(ContentHandler ch) - Get the ContentHandler used for the tree walk.
|
void | traverse(Node pos) - Perform a pre-order traversal non-recursive style.
|
void | traverse(Node pos, Node top) - Perform a pre-order traversal non-recursive style.
|
TreeWalker
public TreeWalker(ContentHandler contentHandler)
Constructor.
contentHandler
- The implemention of the
contentHandler operation (toXMLString, digest, ...)
TreeWalker
public TreeWalker(ContentHandler contentHandler,
DOMHelper dh)
Constructor.
contentHandler
- The implemention of the
contentHandler operation (toXMLString, digest, ...)
TreeWalker
public TreeWalker(ContentHandler contentHandler,
DOMHelper dh,
String systemId)
Constructor.
contentHandler
- The implemention of thesystemId
- System identifier for the document.
contentHandler operation (toXMLString, digest, ...)
getContentHandler
public ContentHandler getContentHandler()
Get the ContentHandler used for the tree walk.
- the ContentHandler used for the tree walk
setContentHandler
public void setContentHandler(ContentHandler ch)
Get the ContentHandler used for the tree walk.
traverse
public void traverse(Node pos)
throws org.xml.sax.SAXException
Perform a pre-order traversal non-recursive style.
Note that TreeWalker assumes that the subtree is intended to represent
a complete (though not necessarily well-formed) document and, during a
traversal, startDocument and endDocument will always be issued to the
SAX listener.
pos
- Node in the tree where to start traversal
traverse
public void traverse(Node pos,
Node top)
throws org.xml.sax.SAXException
Perform a pre-order traversal non-recursive style.
Note that TreeWalker assumes that the subtree is intended to represent
a complete (though not necessarily well-formed) document and, during a
traversal, startDocument and endDocument will always be issued to the
SAX listener.
pos
- Node in the tree where to start traversaltop
- Node in the tree where to end traversal
Copyright B) 2005 Apache XML Project. All Rights Reserved.