public class Traverser extends Object implements Iterator
Document from a
given root Node.
The returned Nodes are returned in document order
(according to XML
Path Language (XPath) Version 1.0, Section 5 ) with the following
restriction: the order of the namespace and attribute child nodes of an
element is not necessarily in document order but fixed for a given
Document.
This Traverser emulates an Iterator over
the result of evaluating the XPath expression
(//. | //@* | //namespace::*) with the XPath evaluation context
setting the initial node equal to the given root node, and setting the
context position and size to 1.
| Constructor and Description |
|---|
Traverser(Node root,
boolean withComments,
boolean emulateXPath)
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
Object |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic Traverser(Node root, boolean withComments, boolean emulateXPath)
root - the root node of the subtree to be traversedwithComments - true if Commentnodes should be
returned by the traverser, or false otherwiseemulateXPath - should the Traverser emulate the evaluation of the
XPath expression (//. | //@* | //namespace::*)?public boolean hasNext()
hasNext in interface IteratorIterator.hasNext()public Object next()
next in interface IteratorIterator.next()public void remove()
remove in interface IteratorIterator.remove()© 2002-2005 IAIK, © 2004, 2006 - 2019 Stiftung SIC