Package org.apache.xml.utils
Class TreeWalker
java.lang.Object
org.apache.xml.utils.TreeWalker
This class does a pre-order walk of the DOM tree, calling a ContentHandler
interface as it goes.
-
Constructor Summary
ConstructorsConstructorDescriptionTreeWalker
(ContentHandler contentHandler) Constructor.TreeWalker
(ContentHandler contentHandler, DOMHelper dh) Constructor.TreeWalker
(ContentHandler contentHandler, DOMHelper dh, String systemId) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the ContentHandler used for the tree walk.void
Get the ContentHandler used for the tree walk.void
Perform a pre-order traversal non-recursive style.void
Perform a pre-order traversal non-recursive style.void
traverseFragment
(Node pos) Perform a pre-order traversal non-recursive style.
-
Constructor Details
-
TreeWalker
Constructor.- Parameters:
contentHandler
- The implemention of thesystemId
- System identifier for the document. contentHandler operation (toXMLString, digest, ...)
-
TreeWalker
Constructor.- Parameters:
contentHandler
- The implemention of the contentHandler operation (toXMLString, digest, ...)
-
TreeWalker
Constructor.- Parameters:
contentHandler
- The implemention of the contentHandler operation (toXMLString, digest, ...)
-
-
Method Details
-
getContentHandler
Get the ContentHandler used for the tree walk.- Returns:
- the ContentHandler used for the tree walk
-
setContentHandler
Get the ContentHandler used for the tree walk. -
traverse
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.- Parameters:
pos
- Node in the tree where to start traversal
-
traverseFragment
Perform a pre-order traversal non-recursive style. In contrast to the traverse() method this method will not issue startDocument() and endDocument() events to the SAX listener.- Parameters:
pos
- Node in the tree where to start traversal
-
traverse
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.- Parameters:
pos
- Node in the tree where to start traversaltop
- Node in the tree where to end traversal
-