18 #if !defined(XPATH_HEADER_GUARD_1357924680) 19 #define XPATH_HEADER_GUARD_1357924680 48 namespace XERCES_CPP_NAMESPACE
63 class XPathConstructionContext;
81 static const XalanDOMChar PSEUDONAME_ANY[];
82 static const XalanDOMChar PSEUDONAME_ROOT[];
83 static const XalanDOMChar PSEUDONAME_TEXT[];
84 static const XalanDOMChar PSEUDONAME_COMMENT[];
85 static const XalanDOMChar PSEUDONAME_PI[];
86 static const XalanDOMChar PSEUDONAME_OTHER[];
87 static const XalanDOMChar PSEUDONAME_NODE[];
106 m_priority(eMatchScoreNone),
112 const XalanDOMChar* theString,
116 m_priority(thePriority),
117 m_targetType(theTargetType)
141 const XalanDOMChar* m_string;
145 eTargetType m_targetType;
154 initialize(MemoryManager& theManager);
169 MemoryManager& theManager,
170 const Locator* theLocator = 0);
174 MemoryManager& theManager,
175 const Locator* theLocator = 0);
180 return m_expression.getMemoryManager();
191 m_expression.shrink();
236 double& result)
const;
271 MemberFunctionPtr
function)
const;
320 return execute(context, prefixResolver, executionContext);
345 execute(context, prefixResolver, executionContext, result);
363 double& result)
const 370 execute(context, prefixResolver, executionContext, result);
396 execute(context, prefixResolver, executionContext, result);
416 MemberFunctionPtr
function)
const 423 execute(context, prefixResolver, executionContext, formatterListener,
function);
459 return execute(context, prefixResolver, executionContext, result);
479 getInitialOpCodePosition(),
502 getInitialOpCodePosition(),
519 double& result)
const 526 getInitialOpCodePosition(),
551 getInitialOpCodePosition(),
570 MemberFunctionPtr
function)
const 577 getInitialOpCodePosition(),
613 getInitialOpCodePosition(),
642 getInitialOpCodePosition(),
671 getInitialOpCodePosition(),
690 double& result)
const 701 getInitialOpCodePosition(),
732 getInitialOpCodePosition(),
750 MemberFunctionPtr
function)
const 761 getInitialOpCodePosition(),
803 getInitialOpCodePosition(),
835 case eMatchScoreNone:
836 return DoubleSupport::getNegativeInfinity();
839 case eMatchScoreNodeTest:
843 case eMatchScoreNSWild:
847 case eMatchScoreOther:
851 case eMatchScoreQName:
900 return executeMore(context, opPos + 2, executionContext);
909 getTargetData(TargetDataVectorType& targetData)
const;
922 s_functions.InstallFunction(funcName,
934 const XalanDOMChar* funcName,
937 s_functions.InstallFunction(funcName,
950 return s_functions.UninstallFunction(funcName);
962 return s_functions.UninstallFunction(funcName);
974 return s_functions.isInstalledFunction(theFunctionName);
995 template<
class OutputIteratorType>
999 s_functions.getInstalledFunctionNames(theIterator);
1005 s_functions.DestroyTable();
1011 return m_inStylesheet;
1017 m_inStylesheet = fValue;
1029 m_locator = theLocator;
1051 const Locator* theLocator = 0,
1066 return (this->*m_testFunction)(context, nodeType);
1072 return (this->*m_testFunction2)(context);
1078 m_executionContext = theRHS.m_executionContext;
1079 m_targetNamespace = theRHS.m_targetNamespace;
1080 m_targetLocalName = theRHS.m_targetLocalName;
1081 m_testFunction = theRHS.m_testFunction;
1082 m_testFunction2 = theRHS.m_testFunction2;
1094 const Locator* theLocator);
1139 testAttributeNCName(
1149 testAttributeNamespaceOnly(
1154 testAttributeTotallyWild(
1169 testElementNamespaceOnly(
1174 testElementTotallyWild(
1185 testElementNamespaceOnly2(
const XalanElement& context)
const;
1188 testElementTotallyWild2(
const XalanElement& context)
const;
1191 testNamespaceNCName(
1196 testNamespaceTotallyWild(
1209 matchLocalName(
const XalanNode& context)
const;
1212 matchNamespaceURI(
const XalanNode& context)
const;
1215 matchLocalNameAndNamespaceURI(
const XalanNode& context)
const;
1218 matchNamespace(
const XalanNode& context)
const;
1221 shouldStripSourceNode(
const XalanText& context)
const;
1230 TestFunctionPtr m_testFunction;
1232 TestFunctionPtr2 m_testFunction2;
1266 bool& theResult)
const;
1281 double& theResult)
const;
1313 MemberFunctionPtr
function)
const;
1330 step(executionContext, context, opPos + 2, theResult);
1344 OpCodeMapPositionType opPos,
1358 OpCodeMapPositionType opPos,
1360 bool& theResult)
const;
1373 OpCodeMapPositionType opPos,
1375 double& theResult)
const;
1389 OpCodeMapPositionType opPos,
1405 OpCodeMapPositionType opPos,
1408 MemberFunctionPtr
function)
const;
1422 OpCodeMapPositionType opPos,
1436 eMatchScore& score)
const;
1448 OpCodeMapPositionType opPos,
1461 OpCodeMapPositionType opPos,
1474 OpCodeMapPositionType opPos,
1487 OpCodeMapPositionType opPos,
1500 OpCodeMapPositionType opPos,
1513 OpCodeMapPositionType opPos,
1526 OpCodeMapPositionType opPos,
1539 OpCodeMapPositionType opPos,
1552 OpCodeMapPositionType opPos,
1566 OpCodeMapPositionType opPos,
1569 MemberFunctionPtr
function)
const;
1581 OpCodeMapPositionType opPos,
1595 OpCodeMapPositionType opPos,
1598 MemberFunctionPtr
function)
const;
1610 OpCodeMapPositionType opPos,
1624 OpCodeMapPositionType opPos,
1627 MemberFunctionPtr
function)
const;
1639 OpCodeMapPositionType opPos,
1653 OpCodeMapPositionType opPos,
1656 MemberFunctionPtr
function)
const;
1668 OpCodeMapPositionType opPos,
1682 OpCodeMapPositionType opPos,
1685 MemberFunctionPtr
function)
const;
1697 OpCodeMapPositionType opPos,
1711 OpCodeMapPositionType opPos,
1714 MemberFunctionPtr
function)
const;
1726 OpCodeMapPositionType opPos,
1740 OpCodeMapPositionType opPos,
1742 bool& result)
const;
1755 OpCodeMapPositionType opPos,
1757 double& result)
const;
1770 OpCodeMapPositionType opPos,
1786 OpCodeMapPositionType opPos,
1789 MemberFunctionPtr
function)
const;
1801 OpCodeMapPositionType opPos,
1813 OpCodeMapPositionType opPos,
1824 OpCodeMapPositionType opPos,
1825 bool& theResult)
const;
1835 OpCodeMapPositionType opPos,
1836 double& theResult)
const;
1847 OpCodeMapPositionType opPos,
1858 OpCodeMapPositionType opPos,
1860 MemberFunctionPtr
function)
const;
1870 OpCodeMapPositionType opPos,
1886 return executeMore(context, opPos + 2, executionContext);
1901 bool& theResult)
const 1903 executeMore(context, opPos + 2, executionContext, theResult);
1918 double& theResult)
const 1920 executeMore(context, opPos + 2, executionContext, theResult);
1937 executeMore(context, opPos + 2, executionContext, theResult);
1955 MemberFunctionPtr
function)
const 1985 if (theValue.
null() ==
false)
2001 numberlit(OpCodeMapPositionType opPos)
const;
2010 OpCodeMapPositionType opPos,
2021 OpCodeMapPositionType opPos,
2022 bool& theResult)
const;
2033 OpCodeMapPositionType opPos,
2045 OpCodeMapPositionType opPos,
2047 MemberFunctionPtr
function)
const;
2059 OpCodeMapPositionType opPos,
2097 OpCodeMapPositionType opPos,
2115 return s_functions[funcID].execute(executionContext, context, argVec, m_locator);
2130 assert(context != 0);
2134 assert(static_cast<double>(theResult) == theResult);
2136 return static_cast<double>(theResult);
2150 assert(static_cast<double>(theResult) == theResult);
2152 return static_cast<double>(theResult);
2166 OpCodeMapPositionType opPos,
2183 assert(context != 0);
2185 return !functionBoolean(context, opPos, executionContext);
2202 assert(context != 0);
2206 executeMore(context, opPos + 2, executionContext, result);
2220 assert(context != 0);
2222 return DOMServices::getNameOfNode(*context);
2236 OpCodeMapPositionType opPos,
2246 functionLocalName(
XalanNode* context)
const;
2259 OpCodeMapPositionType opPos,
2274 assert(context != 0);
2276 return XObject::number(executionContext, *context);
2295 executeMore(context, opPos + 2, executionContext, result);
2314 return DoubleSupport::floor(functionNumber(context, opPos, executionContext));
2331 return DoubleSupport::ceiling(functionNumber(context, opPos, executionContext));
2348 return DoubleSupport::round(functionNumber(context, opPos, executionContext));
2359 functionStringLength(
2372 functionStringLength(
2374 OpCodeMapPositionType opPos,
2388 OpCodeMapPositionType opPos,
2401 OpCodeMapPositionType opPos,
2410 operator=(
const XPath&);
2418 eDefaultTargetDataSize = 5
2421 OpCodeMapPositionType
2422 getInitialOpCodePosition()
const 2424 #if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS) 2425 assert(m_expression.getOpCodeMapValue(0) == XPathExpression::eOP_XPATH);
2427 assert(m_expression.getOpCodeMapValue(
2428 m_expression.getInitialOpCodePosition()) == XPathExpression::eOP_XPATH);
2430 return m_expression.getInitialOpCodePosition() + 2;
2434 locationPathPattern(
2435 XPathExecutionContext& executionContext,
2437 OpCodeMapPositionType opPos)
const;
2451 XPathExecutionContext& executionContext,
2453 OpCodeMapPositionType opPos,
2454 MutableNodeRefList& queryResults)
const;
2468 XPathExecutionContext& executionContext,
2470 OpCodeMapPositionType opPos,
2471 OpCodeMapPositionType startOpPos,
2472 eMatchScore score)
const;
2486 XPathExecutionContext& executionContext,
2488 OpCodeMapPositionType opPos,
2489 eMatchScore& scoreHolder)
const;
2491 OpCodeMapPositionType
2493 XPathExecutionContext& executionContext,
2495 OpCodeMapPositionType opPos,
2496 OpCodeMapValueType stepType,
2497 MutableNodeRefList& subQueryResults)
const;
2499 OpCodeMapPositionType
2501 XPathExecutionContext& executionContext,
2503 OpCodeMapPositionType opPos,
2504 OpCodeMapValueType stepType,
2505 MutableNodeRefList& subQueryResults)
const;
2507 OpCodeMapPositionType
2509 XPathExecutionContext& executionContext,
2511 OpCodeMapPositionType opPos,
2512 OpCodeMapValueType stepType,
2513 MutableNodeRefList& subQueryResults)
const;
2515 OpCodeMapPositionType
2517 XPathExecutionContext& executionContext,
2519 OpCodeMapPositionType opPos,
2520 OpCodeMapValueType stepType,
2521 MutableNodeRefList& subQueryResults)
const;
2523 OpCodeMapPositionType
2525 XPathExecutionContext& executionContext,
2527 OpCodeMapPositionType opPos,
2528 OpCodeMapValueType stepType,
2529 MutableNodeRefList& subQueryResults)
const;
2531 OpCodeMapPositionType
2532 findAncestorsOrSelf(
2533 XPathExecutionContext& executionContext,
2535 OpCodeMapPositionType opPos,
2536 OpCodeMapValueType stepType,
2537 MutableNodeRefList& subQueryResults)
const;
2539 OpCodeMapPositionType
2541 XPathExecutionContext& executionContext,
2543 OpCodeMapPositionType opPos,
2544 OpCodeMapValueType stepType,
2545 MutableNodeRefList& subQueryResults)
const;
2547 OpCodeMapPositionType
2549 XPathExecutionContext& executionContext,
2551 OpCodeMapPositionType opPos,
2552 OpCodeMapValueType stepType,
2553 MutableNodeRefList& subQueryResults)
const;
2555 OpCodeMapPositionType
2557 XPathExecutionContext& executionContext,
2559 OpCodeMapPositionType opPos,
2560 OpCodeMapValueType stepType,
2561 MutableNodeRefList& subQueryResults)
const;
2563 OpCodeMapPositionType
2565 XPathExecutionContext& executionContext,
2567 OpCodeMapPositionType opPos,
2568 OpCodeMapValueType stepType,
2569 MutableNodeRefList& subQueryResults)
const;
2571 OpCodeMapPositionType
2572 findFollowingSiblings(
2573 XPathExecutionContext& executionContext,
2575 OpCodeMapPositionType opPos,
2576 OpCodeMapValueType stepType,
2577 MutableNodeRefList& subQueryResults)
const;
2579 OpCodeMapPositionType
2581 XPathExecutionContext& executionContext,
2583 OpCodeMapPositionType opPos,
2584 OpCodeMapValueType stepType,
2585 MutableNodeRefList& subQueryResults)
const;
2587 OpCodeMapPositionType
2588 findPreceedingSiblings(
2589 XPathExecutionContext& executionContext,
2591 OpCodeMapPositionType opPos,
2592 OpCodeMapValueType stepType,
2593 MutableNodeRefList& subQueryResults)
const;
2595 OpCodeMapPositionType
2597 XPathExecutionContext& executionContext,
2599 OpCodeMapPositionType opPos,
2600 OpCodeMapValueType stepType,
2601 MutableNodeRefList& subQueryResults)
const;
2603 OpCodeMapPositionType
2604 findNodesOnUnknownAxis(
2605 XPathExecutionContext& executionContext,
2607 OpCodeMapPositionType opPos,
2608 OpCodeMapValueType stepType,
2609 MutableNodeRefList& subQueryResults)
const;
2611 OpCodeMapPositionType
2613 XPathExecutionContext& executionContext,
2614 OpCodeMapPositionType opPos,
2615 MutableNodeRefList& subQueryResults)
const;
2619 XPathExecutionContext& executionContext,
2620 XalanNode* localContext,
2621 OpCodeMapPositionType startOpPos)
const;
2624 handleFoundIndexPositional(
2625 XPathExecutionContext& executionContext,
2626 XalanNode* localContext,
2627 OpCodeMapPositionType startOpPos)
const;
2634 XPathExecutionContext& executionContext,
2635 OpCodeMapPositionType opPos)
const;
2640 XPathExecutionContext& executionContext)
const;
2649 XPathExpression m_expression;
2654 const Locator* m_locator;
2661 bool m_inStylesheet;
2668 static FunctionTableType s_functions;
2670 static const XalanDOMString s_emptyString;
2679 #endif // XPATH_HEADER_GUARD_1357924680 void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, MutableNodeRefList &theResult) const
Execute an expression as a group.
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, XalanDOMString &result) const
Execute the XPath from the provided context.
void execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, bool &result) const
Execute the XPath from the provided context.
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, bool &theResult) const
Execute an expression as a group.
bool getInStylesheet() const
const XObjectPtr execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext) const
Execute the XPath from the provided context.
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
virtual NodeType getNodeType() const =0
An enum value representing the type of the underlying object.
static void getInstalledFunctionNames(OutputIteratorType theIterator)
Add the names for the installed functions to a vector strings.
void addNodesInDocOrder(const XalanNodeList &nodelist, XPathExecutionContext &executionContext)
Copy NodeList members into this nodelist, adding in document order.
eMatchScore getDefaultPriority() const
static void installFunction(const XalanDOMChar *funcName, const Function &func)
Install a built-in function.
Local implementation of NodeRefList.
Local implementation of MutableNodeRefList.
static void destroyTable()
OpCodeMapType::const_iterator OpCodeMapPositionType
const XObjectPtr execute(XPathExecutionContext &executionContext) const
Execute the XPath from the provided context.
const XalanDOMChar * getString() const
double functionNumber(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "number".
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, bool &result) const
Execute the XPath from the provided context.
const XObjectPtr predicate(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Evaluate a predicate.
static const FunctionTableType & getFunctionTable()
Retrieve the table of installed functions.
OpCodeMapType::value_type OpCodeMapValueType
void execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute the XPath from the provided context.
This class defines an interface for classes that resolve namespace prefixes to their URIs...
static bool uninstallFunction(const XalanDOMChar *funcName)
Remove a named function from the function table.
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
double functionCeiling(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "ceiling".
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, double &result) const
Execute the XPath from the provided context.
virtual size_type getContextNodeListLength() const =0
virtual const NodeRefListBase & nodeset() const
Cast result object to a nodelist.
static double getMatchScoreValue(eMatchScore score)
Class defines a table of functions that can be called in XPath expresions.
static void installFunction(const XalanDOMString &funcName, const Function &func)
Install a built-in function.
void setLocator(const Locator *theLocator)
XPathExecutionContext::GetCachedString GetCachedString
void shrink()
Shrink internal tables.
XalanVector< TargetData > TargetDataVectorType
void locationPath(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, MutableNodeRefList &theResult) const
Execute a location path.
double functionFloor(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "floor".
const XalanDOMString & functionName(XalanNode *context) const
Handle the built-in function "name".
xercesc::Locator LocatorType
eMatchScore operator()(const XalanNode &context, XalanNode::NodeType nodeType) const
const XObjectPtr execute(XPathExecutionContext &executionContext, MutableNodeRefList &result) const
Execute the XPath from the provided context.
void execute(XPathExecutionContext &executionContext, XalanDOMString &result) const
Execute the XPath from the provided context.
XPathExecutionContext::PrefixResolverSetAndRestore PrefixResolverSetAndRestore
double functionPosition(XalanNode *context, XPathExecutionContext &executionContext) const
Handle the built-in function "position".
XPathExpression::OpCodeMapPositionType OpCodeMapPositionType
Class to hold XObjectPtr return types.
static bool uninstallFunction(const XalanDOMString &funcName)
Remove a named function from the function table.
const Locator * getLocator() const
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, XalanDOMString &theResult) const
Execute an expression as a group.
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute an expression as a group.
const XObjectPtr group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Execute an expression as a group.
double functionNumber(XalanNode *context, XPathExecutionContext &executionContext) const
Handle the built-in function "number".
equals(const XalanDOMChar *theLHS, const XalanDOMChar *theRHS, XalanDOMString::size_type theLength)
Compare the contents of two arrays for equality.
void execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, XalanDOMString &result) const
Execute the XPath from the provided context.
NodeRefListBase::size_type size_type
void execute(XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute the XPath from the provided context.
XPathExpression & getExpression()
Retrieve a reference to the current expression.
TokenQueueSizeType TokenQueuePositionType
const XObjectPtr extfunction(XalanNode *context, OpCodeMapPositionType, const XalanDOMString &theNamespace, const XalanDOMString &functionName, const Function::XObjectArgVectorType &argVec, XPathExecutionContext &executionContext) const
Handle an extension function.
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute the XPath from the provided context.
bool functionNot(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "not".
void execute(XPathExecutionContext &executionContext, bool &result) const
Execute the XPath from the provided context.
const XPathExpression & getExpression() const
Retrieve a reference to the current expression.
virtual const PrefixResolver * getPrefixResolver() const =0
Retrieve the resolver for namespaces.
XPathExpression::OpCodeMapValueType OpCodeMapValueType
eTargetType getTargetType() const
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, double &theResult) const
Execute an expression as a group.
NodeTester & operator=(const NodeTester &theRHS)
XObjectPtr execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, MutableNodeRefList &result) const
Execute the XPath from the provided context.
XPathFunctionTable FunctionTableType
void setDocumentOrder()
Set the known order of the nodes.
XPathExecutionContext::CurrentNodePushAndPop CurrentNodePushAndPop
void execute(XPathExecutionContext &executionContext, double &result) const
Execute the XPath from the provided context.
virtual const XObjectPtr extFunction(const XalanDOMString &theNamespace, const XalanDOMString &functionName, XalanNode *context, const XObjectArgVectorType &argVec, const Locator *locator)=0
Handle an extension function.
void execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, double &result) const
Execute the XPath from the provided context.
#define XALAN_XPATH_EXPORT
void setInStylesheet(bool fValue)
double functionLast(XPathExecutionContext &executionContext) const
Handle the built-in function "last".
TargetData(const XalanDOMChar *theString, eMatchScore thePriority, eTargetType theTargetType)
const XObjectPtr execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, MutableNodeRefList &result) const
Execute the XPath from the provided context.
static bool isInstalledFunction(const XalanDOMString &theFunctionName)
Whether the named function is installed in the function table.
MemoryManager & getMemoryManager()
const XObjectPtr execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext) const
Execute the XPath from the provided context.
XPathExpression::TokenQueuePositionType TokenQueuePositionType
virtual size_type getContextNodeListPosition(const XalanNode &contextNode) const =0
virtual XalanNode * getCurrentNode() const =0
Retrieve the node currently being executed.
eMatchScore operator()(const XalanElement &context) const
double functionRound(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "round".
bool functionBoolean(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "boolean".