Xalan-C++ API Reference  1.12.0
Public Member Functions | Protected Member Functions | List of all members
xalanc::XercesDOMWalker Class Referenceabstract

#include <xalanc/XercesParserLiaison/XercesDOMWalker.hpp>

Inheritance diagram for xalanc::XercesDOMWalker:
[legend]

Public Member Functions

 XercesDOMWalker ()
 Constructor. More...
 
virtual ~XercesDOMWalker ()
 
const DOMNodeTypetraverse (const DOMNodeType *pos)
 Perform a document-order traversal. More...
 
DOMNodeTypetraverse (DOMNodeType *pos)
 Perform a document-order traversal. More...
 
const DOMNodeTypetraverse (const DOMNodeType *pos, const DOMNodeType *parent)
 Perform a document-order traversal stopping at the provided parent node. More...
 
DOMNodeTypetraverse (DOMNodeType *pos, DOMNodeType *parent)
 Perform a document-order traversal stopping at the provided parent node. More...
 
void traverseSubtree (const DOMNodeType *pos)
 Perform a pre-order traversal. More...
 
void traverseSubtree (DOMNodeType *pos)
 Perform a document-order traversal. More...
 

Protected Member Functions

virtual bool startNode (const DOMNodeType *node)=0
 Called when first walking a node. More...
 
virtual bool startNode (DOMNodeType *node)
 Called when first walking a node. More...
 
virtual bool endNode (const DOMNodeType *node)=0
 Called when leaving a node. More...
 
virtual bool endNode (DOMNodeType *node)
 Called when leaving a node. More...
 

Detailed Description

Definition at line 32 of file XercesDOMWalker.hpp.

Constructor & Destructor Documentation

◆ XercesDOMWalker()

xalanc::XercesDOMWalker::XercesDOMWalker ( )

Constructor.

◆ ~XercesDOMWalker()

virtual xalanc::XercesDOMWalker::~XercesDOMWalker ( )
virtual

Member Function Documentation

◆ endNode() [1/2]

virtual bool xalanc::XercesDOMWalker::endNode ( const DOMNodeType node)
protectedpure virtual

Called when leaving a node.

Parameters
nodeThe node
Returns
return false if traversal should continue, or true if it should not.

Implemented in xalanc::XercesDocumentWrapper::BuildWrapperTreeWalker, and xalanc::XercesDOMFormatterWalker.

◆ endNode() [2/2]

virtual bool xalanc::XercesDOMWalker::endNode ( DOMNodeType node)
protectedvirtual

Called when leaving a node.

Parameters
nodeThe node
Returns
return false if traversal should continue, or true if it should not.

◆ startNode() [1/2]

virtual bool xalanc::XercesDOMWalker::startNode ( const DOMNodeType node)
protectedpure virtual

Called when first walking a node.

Parameters
nodeThe node
Returns
return false if traversal should continue, or true if it should not.

Implemented in xalanc::XercesDocumentWrapper::BuildWrapperTreeWalker, and xalanc::XercesDOMFormatterWalker.

◆ startNode() [2/2]

virtual bool xalanc::XercesDOMWalker::startNode ( DOMNodeType node)
protectedvirtual

Called when first walking a node.

Parameters
nodeThe node
Returns
return false if traversal should continue, or true if it should not.

◆ traverse() [1/4]

const DOMNodeType* xalanc::XercesDOMWalker::traverse ( const DOMNodeType pos)

Perform a document-order traversal.

Derived classes and stop the traversal by returning true from startNode() or endNode(). If that happens, the function will return the next node in document order. If desired, the caller can start traversing the tree again from that point. Note that terminal nodes will always have startNode() and endNode() called before the traversal terminates.

Parameters
posThe node in the tree with which to start the walk
Returns
0 if the traversal completes, or the next node if the traversal doesn't complete.

◆ traverse() [2/4]

const DOMNodeType* xalanc::XercesDOMWalker::traverse ( const DOMNodeType pos,
const DOMNodeType parent 
)

Perform a document-order traversal stopping at the provided parent node.

Derived classes and stop the traversal by returning true from startNode() or endNode(). If that happens, the function will return the next node in document order. If desired, the caller can start traversing the tree again from that point. Note that terminal nodes will always have startNode() and endNode() called before the traversal terminates.

Parameters
posThe node in the tree with which to start the walk
parentThe parent of pos. Note that for multiple calls that continue the traversal, this node must remain the same.
Returns
parent if the traversal completes, or the next node if the traversal doesn't complete.

◆ traverse() [3/4]

DOMNodeType* xalanc::XercesDOMWalker::traverse ( DOMNodeType pos)

Perform a document-order traversal.

Derived classes and stop the traversal by returning true from startNode() or endNode(). If that happens, the function will return the next node in document order. If desired, the caller can start traversing the tree again from that point. Note that terminal nodes will always have startNode() and endNode() called before the traversal terminates.

Parameters
posThe node in the tree with which to start the walk
Returns
0 if the traversal completes, or the next node if the traversal doesn't complete.

◆ traverse() [4/4]

DOMNodeType* xalanc::XercesDOMWalker::traverse ( DOMNodeType pos,
DOMNodeType parent 
)

Perform a document-order traversal stopping at the provided parent node.

Derived classes and stop the traversal by returning true from startNode() or endNode(). If that happens, the function will return the next node in document order. If desired, the caller can start traversing the tree again from that point. Note that terminal nodes will always have startNode() and endNode() called before the traversal terminates.

Parameters
posThe node in the tree with which to start the walk
parentThe parent of pos. Note that for multiple calls that continue the traversal, this node must remain the same.
Returns
parent if the traversal completes, or the next node if the traversal doesn't complete.

◆ traverseSubtree() [1/2]

void xalanc::XercesDOMWalker::traverseSubtree ( const DOMNodeType pos)

Perform a pre-order traversal.

Parameters
posstarting node

◆ traverseSubtree() [2/2]

void xalanc::XercesDOMWalker::traverseSubtree ( DOMNodeType pos)

Perform a document-order traversal.

Parameters
posstarting node

The documentation for this class was generated from the following file: