\section{DOM::Node\-Iterator Class Reference}
\label{classDOM_1_1NodeIterator}\index{DOM::NodeIterator@{DOM::NodeIterator}}
Node\-Iterators are used to step through a set of nodes, e.g.  


{\tt \#include $<$dom2\_\-traversal.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Node\-Iterator} (const  {\bf Node\-Iterator} \&other)\label{classDOM_1_1NodeIterator_a1}

\item 
{\bf Node\-Iterator} \& {\bf operator=} (const  {\bf Node\-Iterator} \&other)\label{classDOM_1_1NodeIterator_a2}

\item 
{\bf Node} {\bf root} ()
\begin{CompactList}\small\item\em The root node of the {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})}, as specified when it was created. \item\end{CompactList}\item 
unsigned long {\bf what\-To\-Show} ()
\begin{CompactList}\small\item\em This attribute determines which node types are presented via the iterator. \item\end{CompactList}\item 
{\bf Node\-Filter} {\bf filter} ()
\begin{CompactList}\small\item\em The {\bf Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1NodeFilter})} used to screen nodes. \item\end{CompactList}\item 
bool {\bf expand\-Entity\-References} ()
\begin{CompactList}\small\item\em The value of this flag determines whether the children of entity reference nodes are visible to the iterator. \item\end{CompactList}\item 
{\bf Node} {\bf next\-Node} ()
\begin{CompactList}\small\item\em Returns the next node in the set and advances the position of the Iterator in the set. \item\end{CompactList}\item 
{\bf Node} {\bf previous\-Node} ()
\begin{CompactList}\small\item\em Returns the previous node in the set and moves the position of the Iterator backwards in the set. \item\end{CompactList}\item 
void {\bf detach} ()
\begin{CompactList}\small\item\em Detaches the {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})} from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. \item\end{CompactList}\item 
Node\-Iterator\-Impl $\ast$ {\bf handle} () const \label{classDOM_1_1NodeIterator_a11}

\item 
bool {\bf is\-Null} () const \label{classDOM_1_1NodeIterator_a12}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf Node\-Iterator} (Node\-Iterator\-Impl $\ast$i)\label{classDOM_1_1NodeIterator_b0}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
Node\-Iterator\-Impl $\ast$ {\bf impl}\label{classDOM_1_1NodeIterator_p0}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Node\-Iterator\-Impl}\label{classDOM_1_1NodeIterator_n0}

\item 
class {\bf Document}\label{classDOM_1_1NodeIterator_n1}

\end{CompactItemize}


\subsection{Detailed Description}
Node\-Iterators are used to step through a set of nodes, e.g. 

the set of nodes in a {\bf Node\-List}{\rm (p.\,\pageref{classDOM_1_1NodeList})}, the document subtree governed by a particular node, 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 {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})}. {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2 specifies a single {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})} implementation for document-order traversal of a document subtree. Instances of these iterators are created by calling Document\-Traversal.create\-Node\-Iterator().

Any Iterator that returns nodes may implement the {\tt  {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})} } interface. Users and vendor libraries may also choose to create Iterators that implement the {\tt  {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})} } interface. 



Definition at line 60 of file dom2\_\-traversal.h.

\subsection{Member Function Documentation}
\index{DOM::NodeIterator@{DOM::Node\-Iterator}!root@{root}}
\index{root@{root}!DOM::NodeIterator@{DOM::Node\-Iterator}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node\-Iterator::root ()}\label{classDOM_1_1NodeIterator_a4}


The root node of the {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})}, as specified when it was created. 



Definition at line 64 of file dom2\_\-traversal.cpp.\index{DOM::NodeIterator@{DOM::Node\-Iterator}!whatToShow@{whatToShow}}
\index{whatToShow@{whatToShow}!DOM::NodeIterator@{DOM::Node\-Iterator}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned long Node\-Iterator::what\-To\-Show ()}\label{classDOM_1_1NodeIterator_a5}


This attribute determines which node types are presented via the iterator. 

The available set of constants is defined in the {\bf Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1NodeFilter})} interface. Nodes not accepted by what\-To\-Show will be skipped, but their children may still be considered. Note that this skip takes precedence over the filter, if any. 

Definition at line 70 of file dom2\_\-traversal.cpp.\index{DOM::NodeIterator@{DOM::Node\-Iterator}!filter@{filter}}
\index{filter@{filter}!DOM::NodeIterator@{DOM::Node\-Iterator}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node\-Filter} Node\-Iterator::filter ()}\label{classDOM_1_1NodeIterator_a6}


The {\bf Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1NodeFilter})} used to screen nodes. 



Definition at line 76 of file dom2\_\-traversal.cpp.\index{DOM::NodeIterator@{DOM::Node\-Iterator}!expandEntityReferences@{expandEntityReferences}}
\index{expandEntityReferences@{expandEntityReferences}!DOM::NodeIterator@{DOM::Node\-Iterator}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Node\-Iterator::expand\-Entity\-References ()}\label{classDOM_1_1NodeIterator_a7}


The value of this flag determines whether the children of entity reference nodes are visible to the iterator. 

If false, they and their descendents will be rejected. Note that this rejection takes precedence over what\-To\-Show and the filter. Also note that this is currently the only situation where Node\-Iterators may reject a complete subtree rather than skipping individual nodes.

To produce a view of the document that has entity references expanded and does not expose the entity reference node itself, use the what\-To\-Show flags to hide the entity reference node and set expand\-Entity\-References to true when creating the iterator. To produce a view of the document that has entity reference nodes but no entity expansion, use the what\-To\-Show flags to show the entity reference node and set expand\-Entity\-References to false. 

Definition at line 82 of file dom2\_\-traversal.cpp.\index{DOM::NodeIterator@{DOM::Node\-Iterator}!nextNode@{nextNode}}
\index{nextNode@{nextNode}!DOM::NodeIterator@{DOM::Node\-Iterator}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node\-Iterator::next\-Node ()}\label{classDOM_1_1NodeIterator_a8}


Returns the next node in the set and advances the position of the Iterator in the set. 

After a {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})} is created, the first call to {\bf next\-Node()}{\rm (p.\,\pageref{classDOM_1_1NodeIterator_a8})} returns the first node in the set.

\begin{Desc}
\item[Returns:]The next {\tt  {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})} } in the set being iterated over, or {\tt  null } if there are no more members in that set.\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em Exceptions}]from user code Any exceptions raised by a user-written Filter will propagate through. \end{description}
\end{Desc}


Definition at line 88 of file dom2\_\-traversal.cpp.\index{DOM::NodeIterator@{DOM::Node\-Iterator}!previousNode@{previousNode}}
\index{previousNode@{previousNode}!DOM::NodeIterator@{DOM::Node\-Iterator}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node\-Iterator::previous\-Node ()}\label{classDOM_1_1NodeIterator_a9}


Returns the previous node in the set and moves the position of the Iterator backwards in the set. 

\begin{Desc}
\item[Returns:]The previous {\tt  {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})} } in the set being iterated over, or {\tt  null } if there are no more members in that set.\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em Exceptions}]from user code Any exceptions raised by a user-written Filter will propagate through. \end{description}
\end{Desc}


Definition at line 100 of file dom2\_\-traversal.cpp.\index{DOM::NodeIterator@{DOM::Node\-Iterator}!detach@{detach}}
\index{detach@{detach}!DOM::NodeIterator@{DOM::Node\-Iterator}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Node\-Iterator::detach ()}\label{classDOM_1_1NodeIterator_a10}


Detaches the {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})} from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. 

After detach has been invoked, calls to next\-Node or previous\-Node will raise the exception INVALID\_\-STATE\_\-ERR. 

Definition at line 112 of file dom2\_\-traversal.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
dom2\_\-traversal.h\item 
dom2\_\-traversal.cpp\end{CompactItemize}
