Package org.htmlunit.xpath.xml.dtm.ref
Class DTMNodeIterator
- java.lang.Object
-
- org.htmlunit.xpath.xml.dtm.ref.DTMNodeIterator
-
- All Implemented Interfaces:
org.w3c.dom.traversal.NodeIterator
public class DTMNodeIterator extends java.lang.Object implements org.w3c.dom.traversal.NodeIterator
DTMNodeIterator
gives us an implementation of the DTMNodeIterator which returns DOM nodes.Please note that this is not necessarily equivlaent to a DOM NodeIterator operating over the same document. In particular:
- If there are several Text nodes in logical succession (ie, across CDATASection and EntityReference boundaries), we will return only the first; the caller is responsible for stepping through them. (%REVIEW% Provide a convenience routine here to assist, pending proposed DOM Level 3 getAdjacentText() operation?)
- Since the whole XPath/XSLT architecture assumes that the source document is not altered while we're working with it, we do not promise to implement the DOM NodeIterator's "maintain current position" response to document mutation.
- Since our design for XPath NodeIterators builds a stateful filter directly into the traversal object, getNodeFilter() is not supported.
State: In progress!!
-
-
Field Summary
Fields Modifier and Type Field Description private DTMIterator
dtm_iter
private boolean
valid
-
Constructor Summary
Constructors Constructor Description DTMNodeIterator(DTMIterator dtmIterator)
Public constructor: Wrap a DTMNodeIterator around an existing and preconfigured DTMIterator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
detach()
boolean
getExpandEntityReferences()
org.w3c.dom.traversal.NodeFilter
getFilter()
org.w3c.dom.Node
getRoot()
int
getWhatToShow()
org.w3c.dom.Node
nextNode()
org.w3c.dom.Node
previousNode()
-
-
-
Field Detail
-
dtm_iter
private final DTMIterator dtm_iter
-
valid
private boolean valid
-
-
Constructor Detail
-
DTMNodeIterator
public DTMNodeIterator(DTMIterator dtmIterator)
Public constructor: Wrap a DTMNodeIterator around an existing and preconfigured DTMIterator- Parameters:
dtmIterator
- the iterator to be cloned
-
-
Method Detail
-
detach
public void detach()
- Specified by:
detach
in interfaceorg.w3c.dom.traversal.NodeIterator
-
getExpandEntityReferences
public boolean getExpandEntityReferences()
- Specified by:
getExpandEntityReferences
in interfaceorg.w3c.dom.traversal.NodeIterator
-
getFilter
public org.w3c.dom.traversal.NodeFilter getFilter()
- Specified by:
getFilter
in interfaceorg.w3c.dom.traversal.NodeIterator
-
getRoot
public org.w3c.dom.Node getRoot()
- Specified by:
getRoot
in interfaceorg.w3c.dom.traversal.NodeIterator
-
getWhatToShow
public int getWhatToShow()
- Specified by:
getWhatToShow
in interfaceorg.w3c.dom.traversal.NodeIterator
-
nextNode
public org.w3c.dom.Node nextNode() throws org.w3c.dom.DOMException
- Specified by:
nextNode
in interfaceorg.w3c.dom.traversal.NodeIterator
- Throws:
org.w3c.dom.DOMException
-
previousNode
public org.w3c.dom.Node previousNode()
- Specified by:
previousNode
in interfaceorg.w3c.dom.traversal.NodeIterator
-
-