Xalan-C++ API Documentation
Xalan-C++ API Documentation
The Xalan-C++ XSL Transformer Version 1.0
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
XPath Class Reference
The XPath class represents the semantic parse tree of the XPath pattern.
More...
#include <XPath.hpp>
Collaboration diagram for XPath:
List of all members.
Public Types
Public Methods
- explicit XPath (bool createDefaultLocator = true)
- Construct an XPath and optionally a default locator. More...
- virtual ~XPath ()
- virtual void shrink ()
- Shrink internal tables.
- virtual const XObject* execute ( XalanNode* context, const PrefixResolver& prefixResolver, XPathExecutionContext& executionContext) const
- Execute the XPath from the provided context. More...
- virtual const XObject* execute ( XalanNode* context, const PrefixResolver& prefixResolver, const NodeRefListBase& contextNodeList, XPathExecutionContext& executionContext) const
- Execute the XPath from the provided context. More...
- virtual const XObject* execute (XPathExecutionContext& executionContext) const
- Execute the XPath from the provided context. More...
- virtual const XObject* executeMore ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Execute the XPath from the provided context. More...
- virtual const XObject* locationPath ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Execute a location path. More...
- XPathExpression& getExpression ()
- Retrieve a reference to the current expression. More...
- const XPathExpression& getExpression () const
- Retrieve a reference to the current expression. More...
- virtual double getMatchScore ( XalanNode* context, const PrefixResolver& resolver, XPathExecutionContext& executionContext) const
- Computes the union of its operands which must be node-sets. More...
- virtual double nodeTest ( XalanNode* context, int opPos, int argLen, int stepType, XPathExecutionContext& executionContext) const
- Test a node. More...
- virtual const XObject* predicate ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Evaluate a predicate. More...
- virtual void getTargetElementStrings (TargetElementStringsVectorType& targetStrings) const
- Add the strings for the target element to a vector of strings. More...
Static Public Methods
Static Public Attributes
Protected Methods
- virtual XLocator* createXLocatorHandler () const
- createXLocatorHandler.
- virtual const XObject* xpath ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Execute from the beginning of the xpath. More...
- virtual const XObject* matchPattern ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Computes the union of its operands which must be node-sets. More...
- MutableNodeRefList* step ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Execute a step in a location path. More...
- const XObject* Or ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- OR two expressions and return the boolean result. More...
- const XObject* And ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- OR two expressions and return the boolean result. More...
- const XObject* notequals ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Tell if two expressions are functionally not equal. More...
- const XObject* equals ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Tell if two expressions are functionally equal. More...
- const XObject* lte ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Tell if one argument is less than or equal to the other argument. More...
- const XObject* lt ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Tell if one argument is less than the other argument. More...
- const XObject* gte ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Tell if one argument is greater than or equal to the other argument. More...
- const XObject* gt ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Tell if one argument is greater than the other argument. More...
- const XObject* plus ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Give the sum of two arguments. More...
- const XObject* minus ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Give the difference of two arguments. More...
- const XObject* mult ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Multiply two arguments. More...
- const XObject* div ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Divide a number. More...
- const XObject* mod ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Return the remainder from a truncating division. More...
- const XObject* quo ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Return the remainder from a truncating division. More...
- const XObject* neg ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Return the negation of a number. More...
- const XObject* string ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Cast an expression to a string. More...
- const XObject* boolean ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Cast an expression to a boolean. More...
- const XObject* number ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Cast an expression to a number. More...
- const XObject* Union ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Computes the union of its operands which must be node-sets. More...
- const XObject* literal ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Get a literal value. More...
- const XObject* variable ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Get the value of a variable. More...
- const XObject* group ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Execute an expression as a group. More...
- const XObject* numberlit ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Get a literal value. More...
- const XObject* arg ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Execute a function argument. More...
- const XObject* locationPathPattern ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Execute a location path. More...
- const XObject* runExtFunction ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Setup for and run an extension function.
- const XObject* extfunction ( XalanNode* context, int opPos, const XalanDOMString& theNamespace, const XalanDOMString& functionName, const Function::XObjectArgVectorType& argVec, XPathExecutionContext& executionContext) const
- Handle an extension function.
- const XObject* runFunction ( XalanNode* context, int opPos, XPathExecutionContext& executionContext) const
- Setup for and run a function.
- const XObject* function ( XalanNode* context, int opPos, int funcID, const Function::XObjectArgVectorType& argVec, XPathExecutionContext& executionContext) const
- Handle a built-in function.
Detailed Description
The XPath class represents the semantic parse tree of the XPath pattern.
It
is the representation of the grammar which filters out the choice for
replacement order of the production rules. In order to conserve memory and
reduce object creation, the tree is represented as an array of integers:
[op code][length][...]
where strings are represented within the array as indices into the token
tree.
Member Typedef Documentation
typedef std::vector<XalanDOMString> XPath::TargetElementStringsVectorType |
|
Constructor & Destructor Documentation
explicit XPath::XPath (
|
bool createDefaultLocator = true) |
|
Construct an XPath and optionally a default locator.
-
Parameters:
-
createDefaultLocator
|
true to create a default locator object,
default true
|
virtual XPath::~XPath () [virtual] |
|
Member Function Documentation
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.
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.
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.
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.
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, virtual] |
|
void XPath::destroyTable () [static] |
|
Divide a number.
-
Parameters:
-
context
|
The current source tree context node.
|
opPos
|
The current position in the m_opMap array.
|
-
Returns:
-
arg1 / arg2.
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.
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
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
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
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
Handle an extension function.
Handle a built-in function.
Retrieve a reference to the current expression.
-
Returns:
-
current expression
Retrieve a reference to the current expression.
-
Returns:
-
current expression
Retrieve the table of installed functions.
-
Returns:
-
function table
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
|
Computes the union of its operands which must be node-sets.
-
Parameters:
-
context
|
current source tree context node
|
executionContext
|
current execution context
|
-
Returns:
-
union of node-set operands
Add the strings for the target element to a vector of strings.
-
Parameters:
-
targetStrings
|
vector of strings
|
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.
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.
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.
void XPath::initialize () [static] |
|
Perform static initialization.
See class XPathInit.
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:
-
-
Returns:
-
true if the function has been installed
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.
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
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.
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.
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.
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.
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.
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.
Multiply two arguments.
-
Parameters:
-
context
|
The current source tree context node.
|
opPos
|
The current position in the m_opMap array.
|
-
Returns:
-
arg1 * arg2.
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.
Test a node.
This should be implemented by a derived class.
Returns s_MatchScoreNone by default.
-
Parameters:
-
context
|
current source tree context node
|
opPos
|
current position in the m_opMap array
|
argLen
|
argument length
|
stepType
|
type of step
|
executionContext
|
current execution context
|
-
Returns:
-
one of s_MatchScoreNone, s_MatchScoreNodeTest,
s_MatchScoreQName
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.
Cast an expression to a number.
-
Parameters:
-
context
|
The current source tree context node.
|
opPos
|
The current position in the m_opMap array.
|
-
Returns:
-
arg cast to a number.
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.
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.
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
Return the remainder from a truncating division.
(Quo is no longer supported by xpath).
-
Parameters:
-
context
|
The current source tree context node.
|
opPos
|
The current position in the m_opMap array.
|
-
Returns:
-
arg1 mod arg2.
Setup for and run an extension function.
Setup for and run a function.
void XPath::shrink () [virtual] |
|
Execute a step in a location path.
This must be implemented
by a derived class of XPath (or don't call at all
from the derived implementation of locationPath()).
-
Parameters:
-
context
|
The current source tree context node.
|
opPos
|
The current position in the m_opMap array.
|
-
Returns:
-
a node-set.
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.
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.
Execute from the beginning of the xpath.
-
Parameters:
-
context
|
The current source tree context node.
|
opPos
|
The current position in the m_opMap array.
|
-
Returns:
-
The result of the expression.
Member Data Documentation
const double XPath::s_MatchScoreNSWild [static] |
|
The match score if the pattern has the form NCName:*.
const double XPath::s_MatchScoreNodeTest [static] |
|
The match score if the pattern consists of just a NodeTest.
const double XPath::s_MatchScoreNone [static] |
|
The match score if no match is made.
const double XPath::s_MatchScoreOther [static] |
|
The match score if the pattern consists of something other than just a NodeTest or just a qname.
const double XPath::s_MatchScoreQName [static] |
|
The match score if the pattern has the form of a QName optionally preceded by an @ character.
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++ XSL Transformer Version 1.0
Copyright © 2000 The Apache Software Foundation. All Rights Reserved.
|
|