.TH "DOM::TreeWalker" 3 "28 Jan 2004" "khtml Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
DOM::TreeWalker \- \fC \fBTreeWalker\fP \fP objects are used to navigate a document tree or subtree using the view of the document defined by its \fC whatToShow \fP flags and any filters that are defined for the \fC \fBTreeWalker\fP \fP .  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <dom2_traversal.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBTreeWalker\fP (const  \fBTreeWalker\fP &other)"
.br
.ti -1c
.RI "\fBTreeWalker\fP & \fBoperator=\fP (const  \fBTreeWalker\fP &other)"
.br
.ti -1c
.RI "\fBNode\fP \fBroot\fP ()"
.br
.RI "\fIThe root node of the \fBTreeWalker\fP, as specified when it was created. \fP"
.ti -1c
.RI "unsigned long \fBwhatToShow\fP ()"
.br
.RI "\fIThis attribute determines which node types are presented via the \fBTreeWalker\fP. \fP"
.ti -1c
.RI "\fBNodeFilter\fP \fBfilter\fP ()"
.br
.RI "\fIThe filter used to screen nodes. \fP"
.ti -1c
.RI "bool \fBexpandEntityReferences\fP ()"
.br
.RI "\fIThe value of this flag determines whether the children of entity reference nodes are visible to the \fBTreeWalker\fP. \fP"
.ti -1c
.RI "\fBNode\fP \fBcurrentNode\fP ()"
.br
.RI "\fIThe node at which the \fBTreeWalker\fP is currently positioned. \fP"
.ti -1c
.RI "void \fBsetCurrentNode\fP (const  \fBNode\fP _currentNode)"
.br
.RI "\fIsee \fBcurrentNode\fP \fP"
.ti -1c
.RI "\fBNode\fP \fBparentNode\fP ()"
.br
.RI "\fIMoves to and returns the parent node of the current node. \fP"
.ti -1c
.RI "\fBNode\fP \fBfirstChild\fP ()"
.br
.RI "\fIMoves the \fC \fBTreeWalker\fP \fP to the first child of the current node, and returns the new node. \fP"
.ti -1c
.RI "\fBNode\fP \fBlastChild\fP ()"
.br
.RI "\fIMoves the \fC \fBTreeWalker\fP \fP to the last child of the current node, and returns the new node. \fP"
.ti -1c
.RI "\fBNode\fP \fBpreviousSibling\fP ()"
.br
.RI "\fIMoves the \fC \fBTreeWalker\fP \fP to the previous sibling of the current node, and returns the new node. \fP"
.ti -1c
.RI "\fBNode\fP \fBnextSibling\fP ()"
.br
.RI "\fIMoves the \fC \fBTreeWalker\fP \fP to the next sibling of the current node, and returns the new node. \fP"
.ti -1c
.RI "\fBNode\fP \fBpreviousNode\fP ()"
.br
.RI "\fIMoves the \fC \fBTreeWalker\fP \fP to the previous node in document order relative to the current node, and returns the new node. \fP"
.ti -1c
.RI "\fBNode\fP \fBnextNode\fP ()"
.br
.RI "\fIMoves the \fC \fBTreeWalker\fP \fP to the next node in document order relative to the current node, and returns the new node. \fP"
.ti -1c
.RI "TreeWalkerImpl * \fBhandle\fP () const "
.br
.ti -1c
.RI "bool \fBisNull\fP () const "
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBTreeWalker\fP (TreeWalkerImpl *i)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "TreeWalkerImpl * \fBimpl\fP"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBDocument\fP"
.br
.ti -1c
.RI "class \fBTreeWalkerImpl\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
\fC \fBTreeWalker\fP \fP objects are used to navigate a document tree or subtree using the view of the document defined by its \fC whatToShow \fP flags and any filters that are defined for the \fC \fBTreeWalker\fP \fP . 

Any function which performs navigation using a \fC \fBTreeWalker\fP \fP will automatically support any view defined by a \fC \fBTreeWalker\fP \fP .
.PP
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 \fBTreeWalker\fP view may be children of different, widely separated nodes in the original view. For instance, consider a Filter that skips all nodes except for \fBText\fP 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. 
.PP
Definition at line 339 of file dom2_traversal.h.
.SH "Member Function Documentation"
.PP 
.SS "\fBNode\fP TreeWalker::root ()"
.PP
The root node of the \fBTreeWalker\fP, as specified when it was created. Definition at line 259 of file dom2_traversal.cpp.
.SS "unsigned long TreeWalker::whatToShow ()"
.PP
This attribute determines which node types are presented via the \fBTreeWalker\fP. The available set of constants is defined in the \fBNodeFilter\fP interface. Nodes not accepted by whatToShow 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.
.SS "\fBNodeFilter\fP TreeWalker::filter ()"
.PP
The filter used to screen nodes. Definition at line 271 of file dom2_traversal.cpp.
.SS "bool TreeWalker::expandEntityReferences ()"
.PP
The value of this flag determines whether the children of entity reference nodes are visible to the \fBTreeWalker\fP. If false, they and their descendents will be rejected. Note that this rejection takes precedence over whatToShow and the filter, if any.
.PP
To produce a view of the document that has entity references expanded and does not expose the entity reference node itself, use the whatToShow flags to hide the entity reference node and set expandEntityReferences to true when creating the \fBTreeWalker\fP. To produce a view of the document that has entity reference nodes but no entity expansion, use the whatToShow flags to show the entity reference node and set expandEntityReferences to false. Definition at line 277 of file dom2_traversal.cpp.
.SS "\fBNode\fP TreeWalker::currentNode ()"
.PP
The node at which the \fBTreeWalker\fP is currently positioned. Alterations to the \fBDOM\fP tree may cause the current node to no longer be accepted by the TreeWalker's associated filter. currentNode 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 whatToShow flags. Further traversal occurs relative to currentNode even if it is not part of the current view, by applying the filters in the requested direction; if no traversal is possible, currentNode is not changed.
.PP
\fBExceptions:\fP
.RS 4
\fIDOMException\fP NOT_SUPPORTED_ERR: Raised if an attempt is made to set currentNode to null. 
.RE
.PP
Definition at line 283 of file dom2_traversal.cpp.
.SS "void TreeWalker::setCurrentNode (const \fBNode\fP _currentNode)"
.PP
see \fBcurrentNode\fP Definition at line 289 of file dom2_traversal.cpp.
.SS "\fBNode\fP TreeWalker::parentNode ()"
.PP
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 \fBTreeWalker\fP was created, retains the current position and returns null.
.PP
\fBReturns:\fP
.RS 4
The new parent node, or null if the current node has no parent in the TreeWalker's logical view.
.RE
.PP
\fBExceptions:\fP
.RS 4
\fIExceptions\fP from user code Any exceptions raised by a user-written Filter will propagate through. 
.RE
.PP
Definition at line 294 of file dom2_traversal.cpp.
.SS "\fBNode\fP TreeWalker::firstChild ()"
.PP
Moves the \fC \fBTreeWalker\fP \fP to the first child of the current node, and returns the new node. If the current node has no children, returns \fC null \fP , and retains the current node.
.PP
\fBReturns:\fP
.RS 4
The new node, or \fC null \fP if the current node has no children.
.RE
.PP
\fBExceptions:\fP
.RS 4
\fIExceptions\fP from user code Any exceptions raised by a user-written Filter will propagate through. 
.RE
.PP
Definition at line 300 of file dom2_traversal.cpp.
.SS "\fBNode\fP TreeWalker::lastChild ()"
.PP
Moves the \fC \fBTreeWalker\fP \fP to the last child of the current node, and returns the new node. If the current node has no children, returns \fC null \fP , and retains the current node.
.PP
\fBReturns:\fP
.RS 4
The new node, or \fC null \fP if the current node has no children.
.RE
.PP
\fBExceptions:\fP
.RS 4
\fIExceptions\fP from user code Any exceptions raised by a user-written Filter will propagate through. 
.RE
.PP
Definition at line 306 of file dom2_traversal.cpp.
.SS "\fBNode\fP TreeWalker::previousSibling ()"
.PP
Moves the \fC \fBTreeWalker\fP \fP to the previous sibling of the current node, and returns the new node. If the current node has no previous sibling, returns \fC null \fP , and retains the current node.
.PP
\fBReturns:\fP
.RS 4
The new node, or \fC null \fP if the current node has no previous sibling.
.RE
.PP
\fBExceptions:\fP
.RS 4
\fIExceptions\fP from user code Any exceptions raised by a user-written Filter will propagate through. 
.RE
.PP
Definition at line 312 of file dom2_traversal.cpp.
.SS "\fBNode\fP TreeWalker::nextSibling ()"
.PP
Moves the \fC \fBTreeWalker\fP \fP to the next sibling of the current node, and returns the new node. If the current node has no next sibling, returns \fC null \fP , and retains the current node.
.PP
\fBReturns:\fP
.RS 4
The new node, or \fC null \fP if the current node has no next sibling.
.RE
.PP
\fBExceptions:\fP
.RS 4
\fIExceptions\fP from user code Any exceptions raised by a user-written Filter will propagate through. 
.RE
.PP
Definition at line 318 of file dom2_traversal.cpp.
.SS "\fBNode\fP TreeWalker::previousNode ()"
.PP
Moves the \fC \fBTreeWalker\fP \fP 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 \fC null \fP , and retains the current node.
.PP
\fBReturns:\fP
.RS 4
The new node, or \fC null \fP if the current node has no previous node.
.RE
.PP
\fBExceptions:\fP
.RS 4
\fIExceptions\fP from user code Any exceptions raised by a user-written Filter will propagate through. 
.RE
.PP
Definition at line 324 of file dom2_traversal.cpp.
.SS "\fBNode\fP TreeWalker::nextNode ()"
.PP
Moves the \fC \fBTreeWalker\fP \fP 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 \fC null \fP , and retains the current node.
.PP
\fBReturns:\fP
.RS 4
The new node, or \fC null \fP if the current node has no next node.
.RE
.PP
\fBExceptions:\fP
.RS 4
\fIExceptions\fP from user code Any exceptions raised by a user-written Filter will propagate through. 
.RE
.PP
Definition at line 330 of file dom2_traversal.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for khtml Library from the source code.
