\section{DOM::Tree\-Walker Class Reference}
\label{classDOM_1_1TreeWalker}\index{DOM::TreeWalker@{DOM::TreeWalker}}
{\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} objects are used to navigate a document tree or subtree using the view of the document defined by its {\tt what\-To\-Show} flags and any filters that are defined for the {\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} .  


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

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Tree\-Walker} (const {\bf Tree\-Walker} \&other)\label{classDOM_1_1TreeWalker_a1}

\item 
{\bf Tree\-Walker} \& {\bf operator=} (const {\bf Tree\-Walker} \&other)\label{classDOM_1_1TreeWalker_a2}

\item 
{\bf Node} {\bf root} ()
\item 
unsigned long {\bf what\-To\-Show} ()
\item 
{\bf Node\-Filter} {\bf filter} ()
\item 
bool {\bf expand\-Entity\-References} ()
\item 
{\bf Node} {\bf current\-Node} ()
\item 
void {\bf set\-Current\-Node} (const {\bf Node} \&\_\-current\-Node)
\item 
{\bf Node} {\bf parent\-Node} ()
\item 
{\bf Node} {\bf first\-Child} ()
\item 
{\bf Node} {\bf last\-Child} ()
\item 
{\bf Node} {\bf previous\-Sibling} ()
\item 
{\bf Node} {\bf next\-Sibling} ()
\item 
{\bf Node} {\bf previous\-Node} ()
\item 
{\bf Node} {\bf next\-Node} ()
\item 
Tree\-Walker\-Impl $\ast$ {\bf handle} () const \label{classDOM_1_1TreeWalker_a17}

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

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf Tree\-Walker} (Tree\-Walker\-Impl $\ast$i)\label{classDOM_1_1TreeWalker_b0}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
Tree\-Walker\-Impl $\ast$ {\bf impl}\label{classDOM_1_1TreeWalker_p0}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Document}\label{classDOM_1_1TreeWalker_n0}

\item 
class {\bf Tree\-Walker\-Impl}\label{classDOM_1_1TreeWalker_n1}

\end{CompactItemize}


\subsection{Detailed Description}
{\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} objects are used to navigate a document tree or subtree using the view of the document defined by its {\tt what\-To\-Show} flags and any filters that are defined for the {\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} . 

Any function which performs navigation using a {\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} will automatically support any view defined by a {\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} .

Omitting nodes from the logical view of a subtree can result in a structure that is substantially different from the same subtree in the complete, unfiltered document. Nodes that are siblings in the {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})} view may be children of different, widely separated nodes in the original view. For instance, consider a Filter that skips all nodes except for {\bf Text}{\rm (p.\,\pageref{classDOM_1_1Text})} nodes and the root node of a document. In the logical view that results, all text nodes will be siblings and appear as direct children of the root node, no matter how deeply nested the structure of the original document. 



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

\subsection{Member Function Documentation}
\index{DOM::TreeWalker@{DOM::Tree\-Walker}!root@{root}}
\index{root@{root}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Tree\-Walker::root ()}\label{classDOM_1_1TreeWalker_a4}


The root node of the {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}, as specified when it was created. 



Definition at line 259 of file dom2\_\-traversal.cpp.\index{DOM::TreeWalker@{DOM::Tree\-Walker}!whatToShow@{whatToShow}}
\index{whatToShow@{whatToShow}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned long Tree\-Walker::what\-To\-Show ()}\label{classDOM_1_1TreeWalker_a5}


This attribute determines which node types are presented via the {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}. 

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 265 of file dom2\_\-traversal.cpp.\index{DOM::TreeWalker@{DOM::Tree\-Walker}!filter@{filter}}
\index{filter@{filter}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node\-Filter} Tree\-Walker::filter ()}\label{classDOM_1_1TreeWalker_a6}


The filter used to screen nodes. 



Definition at line 271 of file dom2\_\-traversal.cpp.\index{DOM::TreeWalker@{DOM::Tree\-Walker}!expandEntityReferences@{expandEntityReferences}}
\index{expandEntityReferences@{expandEntityReferences}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Tree\-Walker::expand\-Entity\-References ()}\label{classDOM_1_1TreeWalker_a7}


The value of this flag determines whether the children of entity reference nodes are visible to the {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}. 

If false, they and their descendents will be rejected. Note that this rejection takes precedence over what\-To\-Show and the filter, if any.

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 {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}. 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 277 of file dom2\_\-traversal.cpp.\index{DOM::TreeWalker@{DOM::Tree\-Walker}!currentNode@{currentNode}}
\index{currentNode@{currentNode}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Tree\-Walker::current\-Node ()}\label{classDOM_1_1TreeWalker_a8}


The node at which the {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})} is currently positioned. 

Alterations to the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} tree may cause the current node to no longer be accepted by the Tree\-Walker's associated filter. current\-Node may also be explicitly set to any node, whether or not it is within the subtree specified by the root node or would be accepted by the filter and what\-To\-Show flags. Further traversal occurs relative to current\-Node even if it is not part of the current view, by applying the filters in the requested direction; if no traversal is possible, current\-Node is not changed.

\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]NOT\_\-SUPPORTED\_\-ERR: Raised if an attempt is made to set current\-Node to null. \end{description}
\end{Desc}


Definition at line 283 of file dom2\_\-traversal.cpp.\index{DOM::TreeWalker@{DOM::Tree\-Walker}!setCurrentNode@{setCurrentNode}}
\index{setCurrentNode@{setCurrentNode}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Tree\-Walker::set\-Current\-Node (const {\bf Node} \& {\em \_\-current\-Node})}\label{classDOM_1_1TreeWalker_a9}


see current\-Node 



Definition at line 289 of file dom2\_\-traversal.cpp.\index{DOM::TreeWalker@{DOM::Tree\-Walker}!parentNode@{parentNode}}
\index{parentNode@{parentNode}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Tree\-Walker::parent\-Node ()}\label{classDOM_1_1TreeWalker_a10}


Moves to and returns the parent node of the current node. 

If there is no parent node, or if the current node is the root node from which this {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})} was created, retains the current position and returns null.

\begin{Desc}
\item[Returns:]The new parent node, or null if the current node has no parent in the Tree\-Walker's logical view.\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 294 of file dom2\_\-traversal.cpp.

References DOM::Node::parent\-Node().\index{DOM::TreeWalker@{DOM::Tree\-Walker}!firstChild@{firstChild}}
\index{firstChild@{firstChild}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Tree\-Walker::first\-Child ()}\label{classDOM_1_1TreeWalker_a11}


Moves the {\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} to the first child of the current node, and returns the new node. 

If the current node has no children, returns {\tt null} , and retains the current node.

\begin{Desc}
\item[Returns:]The new node, or {\tt null} if the current node has no children.\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 300 of file dom2\_\-traversal.cpp.

References DOM::Node::first\-Child().\index{DOM::TreeWalker@{DOM::Tree\-Walker}!lastChild@{lastChild}}
\index{lastChild@{lastChild}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Tree\-Walker::last\-Child ()}\label{classDOM_1_1TreeWalker_a12}


Moves the {\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} to the last child of the current node, and returns the new node. 

If the current node has no children, returns {\tt null} , and retains the current node.

\begin{Desc}
\item[Returns:]The new node, or {\tt null} if the current node has no children.\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 306 of file dom2\_\-traversal.cpp.

References DOM::Node::last\-Child().\index{DOM::TreeWalker@{DOM::Tree\-Walker}!previousSibling@{previousSibling}}
\index{previousSibling@{previousSibling}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Tree\-Walker::previous\-Sibling ()}\label{classDOM_1_1TreeWalker_a13}


Moves the {\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} to the previous sibling of the current node, and returns the new node. 

If the current node has no previous sibling, returns {\tt null} , and retains the current node.

\begin{Desc}
\item[Returns:]The new node, or {\tt null} if the current node has no previous sibling.\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 312 of file dom2\_\-traversal.cpp.

References DOM::Node::previous\-Sibling().\index{DOM::TreeWalker@{DOM::Tree\-Walker}!nextSibling@{nextSibling}}
\index{nextSibling@{nextSibling}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Tree\-Walker::next\-Sibling ()}\label{classDOM_1_1TreeWalker_a14}


Moves the {\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} to the next sibling of the current node, and returns the new node. 

If the current node has no next sibling, returns {\tt null} , and retains the current node.

\begin{Desc}
\item[Returns:]The new node, or {\tt null} if the current node has no next sibling.\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 318 of file dom2\_\-traversal.cpp.

References DOM::Node::next\-Sibling().\index{DOM::TreeWalker@{DOM::Tree\-Walker}!previousNode@{previousNode}}
\index{previousNode@{previousNode}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Tree\-Walker::previous\-Node ()}\label{classDOM_1_1TreeWalker_a15}


Moves the {\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} to the previous node in document order relative to the current node, and returns the new node. 

If the current node has no previous node, returns {\tt null} , and retains the current node.

\begin{Desc}
\item[Returns:]The new node, or {\tt null} if the current node has no previous node.\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 324 of file dom2\_\-traversal.cpp.\index{DOM::TreeWalker@{DOM::Tree\-Walker}!nextNode@{nextNode}}
\index{nextNode@{nextNode}!DOM::TreeWalker@{DOM::Tree\-Walker}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Tree\-Walker::next\-Node ()}\label{classDOM_1_1TreeWalker_a16}


Moves the {\tt {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})}} to the next node in document order relative to the current node, and returns the new node. 

If the current node has no next node, returns {\tt null} , and retains the current node.

\begin{Desc}
\item[Returns:]The new node, or {\tt null} if the current node has no next node.\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 330 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}
