Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.4

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

XPath Class Reference

#include <XPath.hpp>

Collaboration diagram for XPath:

List of all members.

Public Types

Public Methods

Static Public Methods

Static Public Attributes

Protected Methods

Protected Attributes

Static Protected Attributes


Detailed Description


Member Typedef Documentation

typedef XPathFunctionTable XPath::FunctionTableType

typedef std::vector<TargetData> XPath::TargetDataVectorType


Member Enumeration Documentation

enum XPath::eMatchScore

Enumeration values:
eMatchScoreNone  
eMatchScoreNodeTest  
eMatchScoreNSWild  
eMatchScoreQName  
eMatchScoreOther  

Constructor & Destructor Documentation

explicit XPath::XPath ( const Locator * theLocator = 0)

Construct an XPath.

Parameters:
theLocator   The applicable Locator, if any.

virtual XPath::~XPath () [virtual]


Member Function Documentation

const XObjectPtr XPath::And ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

OR two expressions and return the boolean result.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
XBoolean set to true if the two arguments are both true.

const XObjectPtr XPath::Or ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

OR two expressions and return the boolean result.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
XBoolean set to true if the one of the two arguments are true.

const XObjectPtr XPath::Union ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Computes the union of its operands which must be node-sets.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
the union of node-set operands.

const XObjectPtr XPath::arg ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Execute a function argument.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
the result of the argument expression.

const XObjectPtr XPath::boolean ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Cast an expression to a boolean.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
arg cast to a boolean.

XLocator * XPath::createXLocatorHandler () const [protected]

createXLocatorHandler.

void XPath::destroyTable () [static]

const XObjectPtr XPath::div ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Divide a number.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
arg1 / arg2.

void XPath::doGetMatchScore ( XalanNode * context,
XPathExecutionContext & executionContext,
eMatchScore & score) const [protected]

Helper function to get match score.

Parameters:
context   The current source tree context node.
executionContext   The current execution context
score   The match score

const XObjectPtr XPath::equals ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Tell if two expressions are functionally equal.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
XBoolean set to true if the two arguments are equal.

const XObjectPtr XPath::execute ( XPathExecutionContext & executionContext) const

Execute the XPath from the provided context.

The prefix resolver must already be set in the execution context.

Parameters:
executionContext   current execution context
Returns:
pointer to result XObject

const XObjectPtr XPath::execute ( XalanNode * context,
const PrefixResolver & prefixResolver,
const NodeRefListBase & contextNodeList,
XPathExecutionContext & executionContext) const

Execute the XPath from the provided context.

Parameters:
context   current source tree context node
prefixResolver   prefix resolver to use
contextNodeList   node list for current context
executionContext   current execution context
Returns:
pointer to union of node-set operands

const XObjectPtr XPath::execute ( XalanNode * context,
const PrefixResolver & prefixResolver,
XPathExecutionContext & executionContext) const

Execute the XPath from the provided context.

Parameters:
context   current source tree context node
prefixResolver   prefix resolver to use
executionContext   current execution context
Returns:
pointer to union of node-set operands

const XObjectPtr XPath::executeMore ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const

Execute the XPath from the provided context.

Parameters:
context   current source tree context node
opPos   current position in the m_opMap array
executionContext   current execution context
Returns:
pointer to union of node-set operands

const XObjectPtr XPath::extfunction ( XalanNode * context,
int,
const XalanDOMString & theNamespace,
const XalanDOMString & functionName,
const Function::XObjectArgVectorType & argVec,
XPathExecutionContext & executionContext) const [protected]

Handle an extension function.

int XPath::findAncestors ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findAncestorsOrSelf ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findAttributes ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findChildren ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findDescendants ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findFollowing ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findFollowingSiblings ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findNamespace ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findNodeSet ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findNodesOnUnknownAxis ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findParent ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findPreceeding ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findPreceedingSiblings ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findRoot ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

int XPath::findSelf ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
int stepType,
MutableNodeRefList & subQueryResults) const [protected]

const XObjectPtr XPath::function ( XalanNode * context,
int funcID,
const Function::XObjectArgVectorType & argVec,
XPathExecutionContext & executionContext) const [protected]

Handle a built-in function.

const XPathExpression & XPath::getExpression () const

Retrieve a reference to the current expression.

Returns:
current expression

XPathExpression & XPath::getExpression ()

Retrieve a reference to the current expression.

Returns:
current expression

const FunctionTableType & XPath::getFunctionTable () [static]

Retrieve the table of installed functions.

Returns:
function table

bool XPath::getInStylesheet () const

template<class OutputIteratorType>
void XPath::getInstalledFunctionNames (
OutputIteratorType theIterator) [static]

Add the names for the installed functions to a vector strings.

Parameters:
theIterator   vector added to

const Locator * XPath::getLocator () const

eMatchScore XPath::getMatchScore ( XalanNode * node,
const PrefixResolver & resolver,
XPathExecutionContext & executionContext) const

Get the match score for the specified node.

Parameters:
node   The node for the score
resolver   The prefix resolver
executionContext   current execution context
Returns:
union of node-set operands

eMatchScore XPath::getMatchScore ( XalanNode * node,
XPathExecutionContext & executionContext) const

Get the match score for the specified node.

Parameters:
node   The node for the score
executionContext   current execution context
Returns:
union of node-set operands

double XPath::getMatchScoreValue ( eMatchScore score) [static]

double XPath::getNumericOperand ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

void XPath::getTargetData ( TargetDataVectorType & targetData) const

Add the data for the target of match pattern to a vector.

Parameters:
targetData   The vector for the data

const XObjectPtr XPath::group ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Execute an expression as a group.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
arg.

const XObjectPtr XPath::gt ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Tell if one argument is greater than the other argument.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
XBoolean set to true if arg 1 is greater than arg 2.

const XObjectPtr XPath::gte ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Tell if one argument is greater than or equal to the other argument.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
XBoolean set to true if arg 1 is greater than or equal to arg 2.

eMatchScore XPath::handleFoundIndex ( XPathExecutionContext & executionContext,
XalanNode * localContext,
int startOpPos) const [protected]

eMatchScore XPath::handleFoundIndexPositional ( XPathExecutionContext & executionContext,
XalanNode * localContext,
int startOpPos) const [protected]

void XPath::initialize () [static]

Perform static initialization.

See class XPathInit.

void XPath::installFunction ( const XalanDOMString & funcName,
const Function & func) [static]

Install a built-in function.

Parameters:
funcName   unqualified name of the function
func   instance of an XPath function object

bool XPath::isInstalledFunction ( const XalanDOMString & theFunctionName) [static]

Whether the named function is installed in the function table.

Parameters:
name   of function
Returns:
true if the function has been installed

const XObjectPtr XPath::literal ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Get a literal value.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
an XObject object.

const XObjectPtr XPath::locationPath ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const

Execute a location path.

Parameters:
context   current source tree context node
opPos   current position in the m_opMap array
executionContext   current execution context
Returns:
node-set

const XObjectPtr XPath::locationPathPattern ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Execute a location path.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
score in an XNumber, one of MATCH_SCORE_NODETEST, MATCH_SCORE_NONE, MATCH_SCORE_OTHER, MATCH_SCORE_QNAME.

const XObjectPtr XPath::lt ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Tell if one argument is less than the other argument.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
XBoolean set to true if arg 1 is less than arg 2.

const XObjectPtr XPath::lte ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Tell if one argument is less than or equal to the other argument.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
XBoolean set to true if arg 1 is less than or equal to arg 2.

const XObjectPtr XPath::matchPattern ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Computes the union of its operands which must be node-sets.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
the match score in the form of an XObject.

const XObjectPtr XPath::minus ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Give the difference of two arguments.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
difference of arg1 and arg2.

const XObjectPtr XPath::mod ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Return the remainder from a truncating division.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
arg1 mod arg2.

const XObjectPtr XPath::mult ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Multiply two arguments.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
arg1 * arg2.

const XObjectPtr XPath::neg ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Return the negation of a number.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
-arg.

eMatchScore XPath::nodeTest ( XPathExecutionContext & executionContext,
XalanNode * context,
XalanNode::NodeType nodeType,
int opPos,
int argLen,
int stepType) const [protected]

const XObjectPtr XPath::notequals ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Tell if two expressions are functionally not equal.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
XBoolean set to true if the two arguments are not equal.

const XObjectPtr XPath::numberlit ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Get a literal value.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
an XObject object.

const XObjectPtr XPath::plus ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Give the sum of two arguments.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
sum of arg1 and arg2.

const XObjectPtr XPath::predicate ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const

Evaluate a predicate.

Parameters:
context   current source tree context node
opPos   current position in the m_opMap array
executionContext   current execution context
Returns:
pointer to either a boolean or a number

void XPath::predicates ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
MutableNodeRefList & subQueryResults,
int & endPredicatesPos) const [protected]

const XObjectPtr XPath::runExtFunction ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Setup for and run an extension function.

const XObjectPtr XPath::runFunction ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Setup for and run a function.

void XPath::setInStylesheet ( bool fValue)

void XPath::setLocator ( const Locator * theLocator)

void XPath::shrink ()

Shrink internal tables.

void XPath::step ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
MutableNodeRefList & queryResults) const [protected]

XalanNode * XPath::stepPattern ( XPathExecutionContext & executionContext,
XalanNode * context,
int opPos,
eMatchScore & scoreHolder) const [protected]

Execute a step in a location path.

Parameters:
xpath   The xpath that is executing
context   The current source tree context node
opPos   The current position in the xpath operation map array
scoreHolder   a reference to an eMatchScore to receive the result.
Returns:
the last matched context node

const XObjectPtr XPath::string ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Cast an expression to a string.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
arg cast to a string.

void XPath::terminate () [static]

Perform static shut down.

See class XPathInit.

bool XPath::uninstallFunction ( const XalanDOMString & funcName) [static]

Remove a named function from the function table.

Parameters:
funcName   name of function
Returns:
true if the function was found and removed.

const XObjectPtr XPath::variable ( XalanNode * context,
int opPos,
XPathExecutionContext & executionContext) const [protected]

Get the value of a variable.

Parameters:
context   The current source tree context node.
opPos   The current position in the m_opMap array.
Returns:
an XObject object.

Member Data Documentation

const XalanDOMChar XPath::PSEUDONAME_ANY[] [static]

const XalanDOMChar XPath::PSEUDONAME_COMMENT[] [static]

const XalanDOMChar XPath::PSEUDONAME_NODE[] [static]

const XalanDOMChar XPath::PSEUDONAME_OTHER[] [static]

const XalanDOMChar XPath::PSEUDONAME_PI[] [static]

const XalanDOMChar XPath::PSEUDONAME_ROOT[] [static]

const XalanDOMChar XPath::PSEUDONAME_TEXT[] [static]

XPathExpression XPath::m_expression [protected]

Holds information about the current expression.

bool XPath::m_inStylesheet [protected]

If true, the XPath can allocated XObjects in more efficient ways, since its lifetime is guaranteed to be at least that of the transform.

const Locator * XPath::m_locator [protected]

A Locator for reporting errors.

const XalanDOMString XPath::s_emptyString [static, protected]

FunctionTableType XPath::s_functions [static, protected]

This is the table of installed functions.


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

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.4
Copyright © 2000, 2001, 2002 The Apache Software Foundation. All Rights Reserved.