<h1>xercesc::DOMNodeIterator Class Reference</h1><!-- doxytag: class="xercesc::DOMNodeIterator" --><code>DOMNodeIterators</code> are used to step through a set of nodes, e.g.
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">The <code>root</code> node of the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code>, as specified when it was created. <ahref="#2456566bcf0b85b45e0d363d8b31e077"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Return which node types are presented via the iterator. <ahref="#fada4dca6194bce8dacdbfeb642700c7"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">The <code><aclass="el"href="classxercesc_1_1DOMNodeFilter.html"title="Filters are objects that know how to "filter out" nodes.">DOMNodeFilter</a></code> used to screen nodes. <ahref="#2199e825391cbe4f915d68055cbf0f63"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Return the expandEntityReferences flag. <ahref="#77413f9c80acb65270794ec51a949102"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the next node in the set and advances the position of the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code> in the set. <ahref="#1390e52c18ba1c69938c4c0e79493b74"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the previous node in the set and moves the position of the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code> backwards in the set. <ahref="#a1b89f85962844c9179ddb07de9dea2f"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Detaches the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code> from the set which it iterated over, releasing any computational resources and placing the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code> in the INVALID state. <ahref="#b69531f583d05578b832dd39baaaa29d"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called to indicate that this NodeIterator is no longer in use and that the implementation may relinquish any resources associated with it. <ahref="#1d40a76868bd11af332d674931dd3b95"></a><br></td></tr>
the set of nodes in a <code><aclass="el"href="classxercesc_1_1DOMNodeList.html"title="The DOMNodeList interface provides the abstraction of an ordered collection of nodes...">DOMNodeList</a></code>, the document subtree governed by a particular <code><aclass="el"href="classxercesc_1_1DOMNode.html"title="The DOMNode interface is the primary datatype for the entire Document Object Model...">DOMNode</a></code>, the results of a query, or any other set of nodes. The set of nodes to be iterated is determined by the implementation of the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code>. DOM Level 2 specifies a single <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code> implementation for document-order traversal of a document subtree. Instances of these <code>DOMNodeIterators</code> are created by calling <code><aclass="el"href="classxercesc_1_1DOMDocumentTraversal.html"title="DOMDocumentTraversal contains methods that create DOMNodeIterators and DOMTreeWalkers...">DOMDocumentTraversal</a></code><code>.createNodeIterator()</code>. <p>
See also the <ahref="http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113">Document Object Model (DOM) Level 2 Traversal and Range Specification</a>. <dlclass="since"compact><dt><b>Since:</b></dt><dd>DOM Level 2 </dd></dl>
The <code>root</code> node of the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code>, as specified when it was created.
This attribute determines which node types are presented via the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code>. The available set of constants is defined in the <code><aclass="el"href="classxercesc_1_1DOMNodeFilter.html"title="Filters are objects that know how to "filter out" nodes.">DOMNodeFilter</a></code> interface. Nodes not accepted by <code>whatToShow</code> will be skipped, but their children may still be considered. Note that this skip takes precedence over the filter, if any. <dlclass="since"compact><dt><b>Since:</b></dt><dd>DOM Level 2 </dd></dl>
The <code><aclass="el"href="classxercesc_1_1DOMNodeFilter.html"title="Filters are objects that know how to "filter out" nodes.">DOMNodeFilter</a></code> used to screen nodes.
The value of this flag determines whether the children of entity reference nodes are visible to the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code>. If false, these children and their descendants will be rejected. Note that this rejection takes precedence over <code>whatToShow</code> and the filter. Also note that this is currently the only situation where <code>DOMNodeIterators</code> may reject a complete subtree rather than skipping individual nodes. <br>
To produce a view of the document that has entity references expanded and does not expose the entity reference node itself, use the <code>whatToShow</code> flags to hide the entity reference node and set <code>expandEntityReferences</code> to true when creating the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code>. To produce a view of the document that has entity reference nodes but no entity expansion, use the <code>whatToShow</code> flags to show the entity reference node and set <code>expandEntityReferences</code> to false.<p>
Returns the next node in the set and advances the position of the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code> in the set.
After a <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code> is created, the first call to <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html#1390e52c18ba1c69938c4c0e79493b74"title="Returns the next node in the set and advances the position of the DOMNodeIterator...">nextNode()</a></code> returns the first node in the set. <dlclass="return"compact><dt><b>Returns:</b></dt><dd>The next <code><aclass="el"href="classxercesc_1_1DOMNode.html"title="The DOMNode interface is the primary datatype for the entire Document Object Model...">DOMNode</a></code> in the set being iterated over, or <code>null</code> if there are no more members in that set. </dd></dl>
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>INVALID_STATE_ERR: Raised if this method is called after the <code>detach</code> method was invoked. </td></tr>
Returns the previous node in the set and moves the position of the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code> backwards in the set.
<dlclass="return"compact><dt><b>Returns:</b></dt><dd>The previous <code><aclass="el"href="classxercesc_1_1DOMNode.html"title="The DOMNode interface is the primary datatype for the entire Document Object Model...">DOMNode</a></code> in the set being iterated over, or <code>null</code> if there are no more members in that set. </dd></dl>
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>INVALID_STATE_ERR: Raised if this method is called after the <code>detach</code> method was invoked. </td></tr>
Detaches the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code> from the set which it iterated over, releasing any computational resources and placing the <code><aclass="el"href="classxercesc_1_1DOMNodeIterator.html"title="DOMNodeIterators are used to step through a set of nodes, e.g.">DOMNodeIterator</a></code> in the INVALID state.
After <code>detach</code> has been invoked, calls to <code>nextNode</code> or <code>previousNode</code> will raise the exception INVALID_STATE_ERR. <dlclass="since"compact><dt><b>Since:</b></dt><dd>DOM Level 2 </dd></dl>
(<aclass="el"href="classxercesc_1_1DOMNodeIterator.html#1d40a76868bd11af332d674931dd3b95"title="Called to indicate that this NodeIterator is no longer in use and that the implementation...">release()</a> will call <aclass="el"href="classxercesc_1_1DOMNodeIterator.html#b69531f583d05578b832dd39baaaa29d"title="Detaches the DOMNodeIterator from the set which it iterated over, releasing any computational...">detach()</a> where appropriate)<p>