## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.10

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# TreeWalker Class Reference

`#include <TreeWalker.hpp>`

Inheritance diagram for TreeWalker:

[legend]
List of all members.

## Public Methods

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

## Protected Methods

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

## Constructor & Destructor Documentation

TreeWalker::TreeWalker ( | )

| Constructor.

TreeWalker::~TreeWalker ( | )`[virtual]`

## Member Function Documentation

bool TreeWalker::endNode ( | XalanNode * node )`[protected, pure virtual]`

Called when leaving a node.

Parameters:

  node | The node

Returns:
  return false if the walk should continue, or true if it should not.

Reimplemented in NodeNameTreeWalker, and FormatterTreeWalker.

bool TreeWalker::endNode ( | const XalanNode * node )`[protected, pure virtual]`

Called when leaving a node.

Parameters:

  node | The node

Returns:
  return false if the walk should continue, or true if it should not.

Reimplemented in NodeNameTreeWalker, and FormatterTreeWalker.

bool TreeWalker::startNode ( | XalanNode * node )`[protected, pure virtual]`

Called when first walking a node.

Parameters:

  node | The node

Returns:
  return false if the walk should continue, or true if it should not.

Reimplemented in NodeNameTreeWalker, and FormatterTreeWalker.

bool TreeWalker::startNode ( | const XalanNode * node )`[protected, pure virtual]`

Called when first walking a node.

Parameters:

  node | The node

Returns:
  return false if the walk should continue, or true if it should not.

Reimplemented in NodeNameTreeWalker, and FormatterTreeWalker.

XalanNode * TreeWalker::traverse ( | XalanNode * pos,
| XalanNode * 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:

  pos | The node in the tree with which to start the walk
  parent | The 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.

const XalanNode * TreeWalker::traverse ( | const XalanNode * pos,
| const XalanNode * 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:

  pos | The node in the tree with which to start the walk
  parent | The 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.

XalanNode * TreeWalker::traverse ( | XalanNode * 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:

  pos | The 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.

const XalanNode * TreeWalker::traverse ( | const XalanNode * 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:

  pos | The 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.

void TreeWalker::traverseSubtree ( | XalanNode * pos )`[virtual]`

Perform a pre-order traversal.

Parameters:

  pos | starting node

void TreeWalker::traverseSubtree ( | const XalanNode * pos )`[virtual]`

Perform a pre-order traversal.

Parameters:

  pos | starting node

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

- TreeWalker.hpp

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.10 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.