Xalan-C++ API Reference  1.12.0
Public Member Functions | Static Public Member Functions | List of all members
xalanc::XPathEvaluator Class Reference

#include <xalanc/XPath/XPathEvaluator.hpp>

Public Member Functions

 XPathEvaluator (MemoryManager &theManager XALAN_DEFAULT_MEMMGR)
 
 ~XPathEvaluator ()
 
XalanNodeselectSingleNode (DOMSupport &domSupport, XalanNode *contextNode, const XalanDOMChar *xpathString, const XalanElement *namespaceNode=0)
 Evaluate the supplied XPath expression, within the given context. More...
 
XalanNodeselectSingleNode (DOMSupport &domSupport, XalanNode *contextNode, const XalanDOMChar *xpathString, const PrefixResolver &prefixResolver)
 Evaluate the supplied XPath expression, within the given context. More...
 
XalanNodeselectSingleNode (DOMSupport &domSupport, XalanNode *contextNode, const XPath &xpath, const XalanElement *namespaceNode=0)
 Evaluate the supplied XPath, within the given context. More...
 
XalanNodeselectSingleNode (DOMSupport &domSupport, XalanNode *contextNode, const XPath &xpath, const PrefixResolver &prefixResolver)
 Evaluate the supplied XPath, within the given context. More...
 
NodeRefListselectNodeList (NodeRefList &result, DOMSupport &domSupport, XalanNode *contextNode, const XalanDOMChar *xpathString, const XalanElement *namespaceNode=0)
 Evaluate the supplied XPath expression, within the given context. More...
 
NodeRefListselectNodeList (NodeRefList &result, DOMSupport &domSupport, XalanNode *contextNode, const XalanDOMChar *xpathString, const PrefixResolver &prefixResolver)
 Evaluate the supplied XPath expression, within the given context. More...
 
NodeRefListselectNodeList (NodeRefList &result, DOMSupport &domSupport, XalanNode *contextNode, const XPath &xpath, const XalanElement *namespaceNode=0)
 Evaluate the supplied XPath, within the given context. More...
 
NodeRefListselectNodeList (NodeRefList &result, 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 expression, within the given context. More...
 
XObjectPtr evaluate (DOMSupport &domSupport, XalanNode *contextNode, const XPath &xpath, const PrefixResolver &prefixResolver)
 Evaluate the supplied XPath expression, within the given context. More...
 
XPathcreateXPath (const XalanDOMChar *xpathString)
 Compile an XPath expression into an object which can be used multiple times. More...
 
XPathcreateXPath (const XalanDOMChar *xpathString, DOMSupport &domSupport, const XalanElement *namespaceNode)
 Compile an XPath expression into an object which can be used multiple times. More...
 
XPathcreateXPath (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...
 
XPathExecutionContextgetExecutionContext ()
 

Static Public Member Functions

static void initialize (MemoryManager &theManager XALAN_DEFAULT_MEMMGR)
 
static void terminate ()
 

Detailed Description

Definition at line 69 of file XPathEvaluator.hpp.

Constructor & Destructor Documentation

◆ XPathEvaluator()

xalanc::XPathEvaluator::XPathEvaluator ( MemoryManager &theManager  XALAN_DEFAULT_MEMMGR)

◆ ~XPathEvaluator()

xalanc::XPathEvaluator::~XPathEvaluator ( )

Member Function Documentation

◆ createXPath() [1/3]

XPath* xalanc::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
xpathStringThe XPath expression to evaluate
Returns
A pointer to an XPath instance.

◆ createXPath() [2/3]

XPath* xalanc::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
xpathStringThe XPath expression to evaluate
prefixResolverA prefix resolver instance to use for namespace prefix resolution.
Returns
A pointer to an XPath instance.

◆ createXPath() [3/3]

XPath* xalanc::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
xpathStringThe XPath expression to evaluate
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
namespaceNodeA node to use for namespace prefix resolution.
Returns
A pointer to an XPath instance.

◆ destroyXPath()

bool xalanc::XPathEvaluator::destroyXPath ( XPath theXPath)

Destory a compiled XPath instance.

The instance must have been created using createXPath().

Parameters
theXPathThe XPath instance to destroy
Returns
true if the instance was successfully destroyed

◆ evaluate() [1/4]

XObjectPtr xalanc::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 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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathStringThe XPath expression to evaluate
prefixResolverA prefix resolver instance to use for namespace prefix resolution.
Returns
The result of evaluting the XPath expression.

◆ evaluate() [2/4]

XObjectPtr xalanc::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 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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathStringThe XPath expression to evaluate
namespaceNodeA node to use for namespace prefix resolution.
Returns
The result of evaluting the XPath expression.

◆ evaluate() [3/4]

XObjectPtr xalanc::XPathEvaluator::evaluate ( DOMSupport domSupport,
XalanNode contextNode,
const XPath xpath,
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 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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathA reference to a compiled XPath expression.
prefixResolverA prefix resolver instance to use for namespace prefix resolution.
Returns
The result of evaluting the XPath expression.

◆ evaluate() [4/4]

XObjectPtr xalanc::XPathEvaluator::evaluate ( DOMSupport domSupport,
XalanNode contextNode,
const XPath xpath,
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 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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathA reference to a compiled XPath expression.
namespaceNodeA node to use for namespace prefix resolution.
Returns
The result of evaluting the XPath expression.

◆ getExecutionContext()

XPathExecutionContext& xalanc::XPathEvaluator::getExecutionContext ( )

◆ initialize()

static void xalanc::XPathEvaluator::initialize ( MemoryManager &theManager  XALAN_DEFAULT_MEMMGR)
static

◆ selectNodeList() [1/4]

NodeRefList& xalanc::XPathEvaluator::selectNodeList ( NodeRefList result,
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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathStringThe XPath expression to evaluate
prefixResolverA prefix resolver instance to use for namespace prefix resolution.
Returns
A list of selected nodes.

◆ selectNodeList() [2/4]

NodeRefList& xalanc::XPathEvaluator::selectNodeList ( NodeRefList result,
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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathStringThe XPath expression to evaluate
namespaceNodeA node to use for namespace prefix resolution.
Returns
A list of selected nodes.

◆ selectNodeList() [3/4]

NodeRefList& xalanc::XPathEvaluator::selectNodeList ( NodeRefList result,
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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathA reference to a compiled XPath expression.
prefixResolverA prefix resolver instance to use for namespace prefix resolution.
Returns
A list of selected nodes.

◆ selectNodeList() [4/4]

NodeRefList& xalanc::XPathEvaluator::selectNodeList ( NodeRefList result,
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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathA reference to a compiled XPath expression.
namespaceNodeA node to use for namespace prefix resolution.
Returns
A list of selected nodes.

◆ selectSingleNode() [1/4]

XalanNode* xalanc::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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathStringThe XPath expression to evaluate
prefixResolverA prefix resolver instance to use for namespace prefix resolution.
Returns
A pointer to the node selected by the expression, if any.

◆ selectSingleNode() [2/4]

XalanNode* xalanc::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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathStringThe XPath expression to evaluate
namespaceNodeA node to use for namespace prefix resolution.
Returns
A pointer to the node selected by the expression, if any.

◆ selectSingleNode() [3/4]

XalanNode* xalanc::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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathA reference to a compiled XPath expression.
prefixResolverA prefix resolver instance to use for namespace prefix resolution.
Returns
A pointer to the node selected by the expression, if any.

◆ selectSingleNode() [4/4]

XalanNode* xalanc::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
domSupportAn instance of the corresponding DOMSupport-derived for the DOM implementation being used.
contextNodeThe source tree context node
xpathA reference to a compiled XPath expression.
namespaceNodeA node to use for namespace prefix resolution.
Returns
A pointer to the node selected by the expression, if any.

◆ terminate()

static void xalanc::XPathEvaluator::terminate ( )
static

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