## Xalan-C++ API Documentation

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

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

# XPathEvaluator Class Reference

`#include <XPathEvaluator.hpp>`

Collaboration diagram for XPathEvaluator:

List of all members.

## Public Methods

- XPathEvaluator ()
- ~XPathEvaluator ()
- XalanNode* selectSingleNode ( DOMSupport& domSupport, XalanNode* contextNode, const XalanDOMChar* xpathString, const XalanElement* namespaceNode = 0)
    Evaluate the supplied XPath expression, within the given context. More...
- XalanNode* selectSingleNode ( DOMSupport& domSupport, XalanNode* contextNode, const XalanDOMChar* xpathString, const PrefixResolver& prefixResolver)
    Evaluate the supplied XPath expression, within the given context. More...
- XalanNode* selectSingleNode ( DOMSupport& domSupport, XalanNode* contextNode, const XPath& xpath, const XalanElement* namespaceNode = 0)
    Evaluate the supplied XPath, within the given context. More...
- XalanNode* selectSingleNode ( DOMSupport& domSupport, XalanNode* contextNode, const XPath& xpath, const PrefixResolver& prefixResolver)
    Evaluate the supplied XPath, within the given context. More...
- NodeRefList selectNodeList ( DOMSupport& domSupport, XalanNode* contextNode, const XalanDOMChar* xpathString, const XalanElement* namespaceNode = 0)
    Evaluate the supplied XPath expression, within the given context. More...
- NodeRefList selectNodeList ( DOMSupport& domSupport, XalanNode* contextNode, const XalanDOMChar* xpathString, const PrefixResolver& prefixResolver)
    Evaluate the supplied XPath expression, within the given context. More...
- NodeRefList selectNodeList ( DOMSupport& domSupport, XalanNode* contextNode, const XPath& xpath, const XalanElement* namespaceNode = 0)
    Evaluate the supplied XPath, within the given context. More...
- NodeRefList selectNodeList ( DOMSupport& domSupport, XalanNode* contextNode, const XPath& xpath, const PrefixResolver& prefixResolver)
    Evaluate the supplied XPath, within the given context. More...
- XObjectPtr evaluate ( DOMSupport& domSupport, XalanNode* contextNode, const XalanDOMChar* xpathString, const XalanElement* namespaceNode = 0)
    Evaluate the supplied XPath expression, within the given context. More...
- XObjectPtr evaluate ( DOMSupport& domSupport, XalanNode* contextNode, const XalanDOMChar* xpathString, const PrefixResolver& prefixResolver)
    Evaluate the supplied XPath expression, within the given context. More...
- XObjectPtr evaluate ( DOMSupport& domSupport, XalanNode* contextNode, const XPath& xpath, const XalanElement* namespaceNode = 0)
    Evaluate the supplied XPath, within the given context. More...
- XObjectPtr evaluate ( DOMSupport& domSupport, XalanNode* contextNode, const XPath& xpath, const PrefixResolver& prefixResolver)
    Evaluate the supplied XPath, within the given context. More...
- XPath* createXPath (const XalanDOMChar* xpathString)
    Compile an XPath expression into an object which can be used multiple times. More...
- XPath* createXPath ( const XalanDOMChar* xpathString, DOMSupport& domSupport, const XalanElement* namespaceNode)
    Compile an XPath expression into an object which can be used multiple times. More...
- XPath* createXPath ( const XalanDOMChar* xpathString, const PrefixResolver& prefixResolver)
    Compile an XPath expression into an object which can be used multiple times. More...
- bool destroyXPath (XPath* theXPath)
    Destory a compiled XPath instance. More...

## Static Public Methods

- void initialize ()
- void terminate ()

## Constructor & Destructor Documentation

XPathEvaluator::XPathEvaluator ( | )

XPathEvaluator::~XPathEvaluator ( | )

## Member Function Documentation

XPath * XPathEvaluator::createXPath ( | const XalanDOMChar * xpathString,
| const PrefixResolver & prefixResolver )

Compile an XPath expression into an object which can be used multiple times.

Call destroyXPath() when finished with the instance. Otherwise, the object will be destroyed when the XPathEvaluator instance goes out of scope.

Parameters:

  xpathString | The XPath expression to evaluate
  prefixResolver | A prefix resolver instance to use for namespace prefix resolution.

Returns:
  A pointer to an XPath instance.

XPath * XPathEvaluator::createXPath ( | const XalanDOMChar * xpathString,
| DOMSupport & domSupport,
| const XalanElement * namespaceNode )

Compile an XPath expression into an object which can be used multiple times.

Call destroyXPath() when finished with the instance. Otherwise, the object will be destroyed when the XPathEvaluator instance goes out of scope.

Parameters:

  xpathString | The XPath expression to evaluate
  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  namespaceNode | A node to use for namespace prefix resolution.

Returns:
  A pointer to an XPath instance.

XPath * XPathEvaluator::createXPath ( | const XalanDOMChar * xpathString )

Compile an XPath expression into an object which can be used multiple times.

Call destroyXPath() when finished with the instance. Otherwise, the object will be destroyed when the XPathEvaluator instance goes out of scope. Since no PrefixResolver is supplied, the XPath expression may not contain any namespace prefixes.

Parameters:

  xpathString | The XPath expression to evaluate

Returns:
  A pointer to an XPath instance.

bool XPathEvaluator::destroyXPath ( | XPath * theXPath )

Destory a compiled XPath instance.

The instance must have been created using createXPath().

Parameters:

  theXPath | The XPath instance to destroy

Returns:
  true if the instance was successfully destroyed

XObjectPtr XPathEvaluator::evaluate ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XPath & xpath,
| const PrefixResolver & prefixResolver )

Evaluate the supplied XPath, within the given context.

The result is returned as a generalized object. The object will be destroyed when the returned when the user's copy of the returned XObjectPtr goes out of scope, or when the XPathEvaluator goes out of scope or another expression is evaluated.

The user's XObjectPtr copy _must_ no longer be in scope when the XPathEvaluator instance goes out of scope, or another expression is evaluated.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpath | A reference to a compiled XPath expression.
  prefixResolver | A prefix resolver instance to use for namespace prefix resolution.

Returns:
  The result of evaluting the XPath expression.

XObjectPtr XPathEvaluator::evaluate ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XPath & xpath,
| const XalanElement * namespaceNode = 0 )

Evaluate the supplied XPath, within the given context.

The result is returned as a generalized object. The object will be destroyed when the returned when the user's copy of the returned XObjectPtr goes out of scope, or when the XPathEvaluator goes out of scope or another expression is evaluated.

The user's XObjectPtr copy _must_ no longer be in scope when the XPathEvaluator instance goes out of scope, or another expression is evaluated.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpath | A reference to a compiled XPath expression.
  namespaceNode | A node to use for namespace prefix resolution.

Returns:
  The result of evaluting the XPath expression.

XObjectPtr XPathEvaluator::evaluate ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XalanDOMChar * xpathString,
| const PrefixResolver & prefixResolver )

Evaluate the supplied XPath expression, within the given context.

The result is returned as a generalized object. The object will be destroyed when the returned when the user's copy of the returned XObjectPtr goes out of scope, or when the XPathEvaluator goes out of scope or another expression is evaluated.

The user's XObjectPtr copy _must_ no longer be in scope when the XPathEvaluator instance goes out of scope, or another expression is evaluated.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpathString | The XPath expression to evaluate
  prefixResolver | A prefix resolver instance to use for namespace prefix resolution.

Returns:
  The result of evaluting the XPath expression.

XObjectPtr XPathEvaluator::evaluate ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XalanDOMChar * xpathString,
| const XalanElement * namespaceNode = 0 )

Evaluate the supplied XPath expression, within the given context.

The result is returned as a generalized object. The object will be destroyed when the returned when the user's copy of the returned XObjectPtr goes out of scope, or when the XPathEvaluator goes out of scope or another expression is evaluated.

The user's XObjectPtr copy _must_ no longer be in scope when the XPathEvaluator instance goes out of scope, or another expression is evaluated.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpathString | The XPath expression to evaluate
  namespaceNode | A node to use for namespace prefix resolution.

Returns:
  The result of evaluting the XPath expression.

void XPathEvaluator::initialize ( | )`[static]`

NodeRefList XPathEvaluator::selectNodeList ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XPath & xpath,
| const PrefixResolver & prefixResolver )

Evaluate the supplied XPath, within the given context.

If the expression doesn't select a node, an empty list is returned.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpath | A reference to a compiled XPath expression.
  prefixResolver | A prefix resolver instance to use for namespace prefix resolution.

Returns:
  A list of selected nodes.

NodeRefList XPathEvaluator::selectNodeList ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XPath & xpath,
| const XalanElement * namespaceNode = 0 )

Evaluate the supplied XPath, within the given context.

If the expression doesn't select a node, an empty list is returned.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpath | A reference to a compiled XPath expression.
  namespaceNode | A node to use for namespace prefix resolution.

Returns:
  A list of selected nodes.

NodeRefList XPathEvaluator::selectNodeList ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XalanDOMChar * xpathString,
| const PrefixResolver & prefixResolver )

Evaluate the supplied XPath expression, within the given context.

If the expression doesn't select a node, an empty list is returned.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpathString | The XPath expression to evaluate
  prefixResolver | A prefix resolver instance to use for namespace prefix resolution.

Returns:
  A list of selected nodes.

NodeRefList XPathEvaluator::selectNodeList ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XalanDOMChar * xpathString,
| const XalanElement * namespaceNode = 0 )

Evaluate the supplied XPath expression, within the given context.

If the expression doesn't select a node, an empty list is returned.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpathString | The XPath expression to evaluate
  namespaceNode | A node to use for namespace prefix resolution.

Returns:
  A list of selected nodes.

XalanNode * XPathEvaluator::selectSingleNode ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XPath & xpath,
| const PrefixResolver & prefixResolver )

Evaluate the supplied XPath, within the given context.

If the expression doesn't select a node, 0 is returned. If it selects more than one node, only the first is returned.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpath | A reference to a compiled XPath expression.
  prefixResolver | A prefix resolver instance to use for namespace prefix resolution.

Returns:
  A pointer to the node selected by the expression, if any.

XalanNode * XPathEvaluator::selectSingleNode ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XPath & xpath,
| const XalanElement * namespaceNode = 0 )

Evaluate the supplied XPath, within the given context.

If the expression doesn't select a node, 0 is returned. If it selects more than one node, only the first is returned.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpath | A reference to a compiled XPath expression.
  namespaceNode | A node to use for namespace prefix resolution.

Returns:
  A pointer to the node selected by the expression, if any.

XalanNode * XPathEvaluator::selectSingleNode ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XalanDOMChar * xpathString,
| const PrefixResolver & prefixResolver )

Evaluate the supplied XPath expression, within the given context.

If the expression doesn't select a node, 0 is returned. If it selects more than one node, only the first is returned.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpathString | The XPath expression to evaluate
  prefixResolver | A prefix resolver instance to use for namespace prefix resolution.

Returns:
  A pointer to the node selected by the expression, if any.

XalanNode * XPathEvaluator::selectSingleNode ( | DOMSupport & domSupport,
| XalanNode * contextNode,
| const XalanDOMChar * xpathString,
| const XalanElement * namespaceNode = 0 )

Evaluate the supplied XPath expression, within the given context.

If the expression doesn't select a node, 0 is returned. If it selects more than one node, only the first is returned.

Parameters:

  domSupport | An instance of the corresponding DOMSupport-derived for the DOM implementation being used.
  contextNode | The source tree context node
  xpathString | The XPath expression to evaluate
  namespaceNode | A node to use for namespace prefix resolution.

Returns:
  A pointer to the node selected by the expression, if any.

void XPathEvaluator::terminate ( | )`[static]`

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

- XPathEvaluator.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.7 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.