18 #if !defined(XPATH_HEADER_GUARD_1357924680) 19 #define XPATH_HEADER_GUARD_1357924680 48 XALAN_DECLARE_XERCES_CLASS(Locator)
52 XALAN_CPP_NAMESPACE_BEGIN
78 static const XalanDOMChar PSEUDONAME_ANY[];
79 static const XalanDOMChar PSEUDONAME_ROOT[];
80 static const XalanDOMChar PSEUDONAME_TEXT[];
81 static const XalanDOMChar PSEUDONAME_COMMENT[];
82 static const XalanDOMChar PSEUDONAME_PI[];
83 static const XalanDOMChar PSEUDONAME_OTHER[];
84 static const XalanDOMChar PSEUDONAME_NODE[];
103 m_priority(eMatchScoreNone),
109 const XalanDOMChar* theString,
113 m_priority(thePriority),
114 m_targetType(theTargetType)
138 const XalanDOMChar* m_string;
151 initialize(MemoryManager& theManager);
166 MemoryManager& theManager,
167 const Locator* theLocator = 0);
171 MemoryManager& theManager,
172 const Locator* theLocator = 0);
177 return m_expression.getMemoryManager();
188 m_expression.shrink();
233 double& result)
const;
268 MemberFunctionPtr
function)
const;
317 return execute(context, prefixResolver, executionContext);
342 execute(context, prefixResolver, executionContext, result);
360 double& result)
const 367 execute(context, prefixResolver, executionContext, result);
393 execute(context, prefixResolver, executionContext, result);
413 MemberFunctionPtr
function)
const 420 execute(context, prefixResolver, executionContext, formatterListener,
function);
456 return execute(context, prefixResolver, executionContext, result);
476 getInitialOpCodePosition(),
499 getInitialOpCodePosition(),
516 double& result)
const 523 getInitialOpCodePosition(),
548 getInitialOpCodePosition(),
567 MemberFunctionPtr
function)
const 574 getInitialOpCodePosition(),
610 getInitialOpCodePosition(),
633 const PrefixResolverSetAndRestore theResolverSetAndRestore(
639 getInitialOpCodePosition(),
662 const PrefixResolverSetAndRestore theResolverSetAndRestore(
668 getInitialOpCodePosition(),
687 double& result)
const 692 const PrefixResolverSetAndRestore theResolverSetAndRestore(
698 getInitialOpCodePosition(),
723 const PrefixResolverSetAndRestore theResolverSetAndRestore(
729 getInitialOpCodePosition(),
747 MemberFunctionPtr
function)
const 752 const PrefixResolverSetAndRestore theResolverSetAndRestore(
758 getInitialOpCodePosition(),
794 const PrefixResolverSetAndRestore theResolverSetAndRestore(
800 getInitialOpCodePosition(),
832 case eMatchScoreNone:
836 case eMatchScoreNodeTest:
840 case eMatchScoreNSWild:
844 case eMatchScoreOther:
848 case eMatchScoreQName:
894 OpCodeMapPositionType opPos,
897 return executeMore(context, opPos + 2, executionContext);
906 getTargetData(TargetDataVectorType& targetData)
const;
919 s_functions.InstallFunction(funcName,
931 const XalanDOMChar* funcName,
934 s_functions.InstallFunction(funcName,
947 return s_functions.UninstallFunction(funcName);
959 return s_functions.UninstallFunction(funcName);
971 return s_functions.isInstalledFunction(theFunctionName);
981 static const FunctionTableType&
992 template<
class OutputIteratorType>
996 s_functions.getInstalledFunctionNames(theIterator);
1002 s_functions.DestroyTable();
1008 return m_inStylesheet;
1014 m_inStylesheet = fValue;
1026 m_locator = theLocator;
1040 OpCodeMapPositionType opPos,
1041 OpCodeMapValueType argLen,
1042 OpCodeMapValueType stepType);
1048 const Locator* theLocator = 0,
1063 return (this->*m_testFunction)(context, nodeType);
1069 return (this->*m_testFunction2)(context);
1075 m_executionContext = theRHS.m_executionContext;
1076 m_targetNamespace = theRHS.m_targetNamespace;
1077 m_targetLocalName = theRHS.m_targetLocalName;
1078 m_testFunction = theRHS.m_testFunction;
1079 m_testFunction2 = theRHS.m_testFunction2;
1091 const Locator* theLocator);
1107 const XalanNode& context,
1112 const XalanNode& context,
1117 const XalanNode& context,
1122 const XalanNode& context,
1127 const XalanNode& context,
1132 const XalanNode& context,
1136 testAttributeNCName(
1137 const XalanNode& context,
1142 const XalanNode& context,
1146 testAttributeNamespaceOnly(
1147 const XalanNode& context,
1151 testAttributeTotallyWild(
1152 const XalanNode& context,
1157 const XalanNode& context,
1162 const XalanNode& context,
1166 testElementNamespaceOnly(
1167 const XalanNode& context,
1171 testElementTotallyWild(
1172 const XalanNode& context,
1182 testElementNamespaceOnly2(
const XalanElement& context)
const;
1185 testElementTotallyWild2(
const XalanElement& context)
const;
1188 testNamespaceNCName(
1189 const XalanNode& context,
1193 testNamespaceTotallyWild(
1194 const XalanNode& context,
1199 const XalanNode& context,
1206 matchLocalName(
const XalanNode& context)
const;
1209 matchNamespaceURI(
const XalanNode& context)
const;
1212 matchLocalNameAndNamespaceURI(
const XalanNode& context)
const;
1215 matchNamespace(
const XalanNode& context)
const;
1218 shouldStripSourceNode(
const XalanText& context)
const;
1227 TestFunctionPtr m_testFunction;
1229 TestFunctionPtr2 m_testFunction2;
1247 OpCodeMapPositionType opPos,
1261 OpCodeMapPositionType opPos,
1263 bool& theResult)
const;
1276 OpCodeMapPositionType opPos,
1278 double& theResult)
const;
1291 OpCodeMapPositionType opPos,
1307 OpCodeMapPositionType opPos,
1310 MemberFunctionPtr
function)
const;
1323 OpCodeMapPositionType opPos,
1327 step(executionContext, context, opPos + 2, theResult);
1341 OpCodeMapPositionType opPos,
1355 OpCodeMapPositionType opPos,
1357 bool& theResult)
const;
1370 OpCodeMapPositionType opPos,
1372 double& theResult)
const;
1386 OpCodeMapPositionType opPos,
1402 OpCodeMapPositionType opPos,
1405 MemberFunctionPtr
function)
const;
1419 OpCodeMapPositionType opPos,
1445 OpCodeMapPositionType opPos,
1458 OpCodeMapPositionType opPos,
1471 OpCodeMapPositionType opPos,
1484 OpCodeMapPositionType opPos,
1497 OpCodeMapPositionType opPos,
1510 OpCodeMapPositionType opPos,
1523 OpCodeMapPositionType opPos,
1536 OpCodeMapPositionType opPos,
1549 OpCodeMapPositionType opPos,
1563 OpCodeMapPositionType opPos,
1566 MemberFunctionPtr
function)
const;
1578 OpCodeMapPositionType opPos,
1592 OpCodeMapPositionType opPos,
1595 MemberFunctionPtr
function)
const;
1607 OpCodeMapPositionType opPos,
1621 OpCodeMapPositionType opPos,
1624 MemberFunctionPtr
function)
const;
1636 OpCodeMapPositionType opPos,
1650 OpCodeMapPositionType opPos,
1653 MemberFunctionPtr
function)
const;
1665 OpCodeMapPositionType opPos,
1679 OpCodeMapPositionType opPos,
1682 MemberFunctionPtr
function)
const;
1694 OpCodeMapPositionType opPos,
1708 OpCodeMapPositionType opPos,
1711 MemberFunctionPtr
function)
const;
1723 OpCodeMapPositionType opPos,
1737 OpCodeMapPositionType opPos,
1739 bool& result)
const;
1752 OpCodeMapPositionType opPos,
1754 double& result)
const;
1767 OpCodeMapPositionType opPos,
1783 OpCodeMapPositionType opPos,
1786 MemberFunctionPtr
function)
const;
1798 OpCodeMapPositionType opPos,
1810 OpCodeMapPositionType opPos,
1821 OpCodeMapPositionType opPos,
1822 bool& theResult)
const;
1832 OpCodeMapPositionType opPos,
1833 double& theResult)
const;
1844 OpCodeMapPositionType opPos,
1855 OpCodeMapPositionType opPos,
1857 MemberFunctionPtr
function)
const;
1867 OpCodeMapPositionType opPos,
1880 OpCodeMapPositionType opPos,
1883 return executeMore(context, opPos + 2, executionContext);
1896 OpCodeMapPositionType opPos,
1898 bool& theResult)
const 1900 executeMore(context, opPos + 2, executionContext, theResult);
1913 OpCodeMapPositionType opPos,
1915 double& theResult)
const 1917 executeMore(context, opPos + 2, executionContext, theResult);
1930 OpCodeMapPositionType opPos,
1934 executeMore(context, opPos + 2, executionContext, theResult);
1949 OpCodeMapPositionType opPos,
1952 MemberFunctionPtr
function)
const 1972 OpCodeMapPositionType opPos,
1982 if (theValue.
null() ==
false)
1998 numberlit(OpCodeMapPositionType opPos)
const;
2007 OpCodeMapPositionType opPos,
2018 OpCodeMapPositionType opPos,
2019 bool& theResult)
const;
2030 OpCodeMapPositionType opPos,
2042 OpCodeMapPositionType opPos,
2044 MemberFunctionPtr
function)
const;
2056 OpCodeMapPositionType opPos,
2071 OpCodeMapPositionType ,
2094 OpCodeMapPositionType opPos,
2108 OpCodeMapValueType funcID,
2112 return s_functions[funcID].execute(executionContext, context, argVec, m_locator);
2127 assert(context != 0);
2131 assert(static_cast<double>(theResult) == theResult);
2133 return static_cast<double>(theResult);
2147 assert(static_cast<double>(theResult) == theResult);
2149 return static_cast<double>(theResult);
2163 OpCodeMapPositionType opPos,
2177 OpCodeMapPositionType opPos,
2180 assert(context != 0);
2182 return !functionBoolean(context, opPos, executionContext);
2196 OpCodeMapPositionType opPos,
2199 assert(context != 0);
2203 executeMore(context, opPos + 2, executionContext, result);
2217 assert(context != 0);
2233 OpCodeMapPositionType opPos,
2243 functionLocalName(
XalanNode* context)
const;
2256 OpCodeMapPositionType opPos,
2271 assert(context != 0);
2287 OpCodeMapPositionType opPos,
2292 executeMore(context, opPos + 2, executionContext, result);
2308 OpCodeMapPositionType opPos,
2325 OpCodeMapPositionType opPos,
2342 OpCodeMapPositionType opPos,
2356 functionStringLength(
2369 functionStringLength(
2371 OpCodeMapPositionType opPos,
2385 OpCodeMapPositionType opPos,
2398 OpCodeMapPositionType opPos,
2407 operator=(
const XPath&);
2415 eDefaultTargetDataSize = 5
2418 OpCodeMapPositionType
2419 getInitialOpCodePosition()
const 2421 #if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS) 2424 assert(m_expression.getOpCodeMapValue(
2427 return m_expression.getInitialOpCodePosition() + 2;
2431 locationPathPattern(
2434 OpCodeMapPositionType opPos)
const;
2450 OpCodeMapPositionType opPos,
2467 OpCodeMapPositionType opPos,
2468 OpCodeMapPositionType startOpPos,
2485 OpCodeMapPositionType opPos,
2488 OpCodeMapPositionType
2492 OpCodeMapPositionType opPos,
2493 OpCodeMapValueType stepType,
2496 OpCodeMapPositionType
2500 OpCodeMapPositionType opPos,
2501 OpCodeMapValueType stepType,
2504 OpCodeMapPositionType
2508 OpCodeMapPositionType opPos,
2509 OpCodeMapValueType stepType,
2512 OpCodeMapPositionType
2516 OpCodeMapPositionType opPos,
2517 OpCodeMapValueType stepType,
2520 OpCodeMapPositionType
2524 OpCodeMapPositionType opPos,
2525 OpCodeMapValueType stepType,
2528 OpCodeMapPositionType
2529 findAncestorsOrSelf(
2532 OpCodeMapPositionType opPos,
2533 OpCodeMapValueType stepType,
2536 OpCodeMapPositionType
2540 OpCodeMapPositionType opPos,
2541 OpCodeMapValueType stepType,
2544 OpCodeMapPositionType
2548 OpCodeMapPositionType opPos,
2549 OpCodeMapValueType stepType,
2552 OpCodeMapPositionType
2556 OpCodeMapPositionType opPos,
2557 OpCodeMapValueType stepType,
2560 OpCodeMapPositionType
2564 OpCodeMapPositionType opPos,
2565 OpCodeMapValueType stepType,
2568 OpCodeMapPositionType
2569 findFollowingSiblings(
2572 OpCodeMapPositionType opPos,
2573 OpCodeMapValueType stepType,
2576 OpCodeMapPositionType
2580 OpCodeMapPositionType opPos,
2581 OpCodeMapValueType stepType,
2584 OpCodeMapPositionType
2585 findPreceedingSiblings(
2588 OpCodeMapPositionType opPos,
2589 OpCodeMapValueType stepType,
2592 OpCodeMapPositionType
2596 OpCodeMapPositionType opPos,
2597 OpCodeMapValueType stepType,
2600 OpCodeMapPositionType
2601 findNodesOnUnknownAxis(
2604 OpCodeMapPositionType opPos,
2605 OpCodeMapValueType stepType,
2608 OpCodeMapPositionType
2611 OpCodeMapPositionType opPos,
2618 OpCodeMapPositionType startOpPos)
const;
2621 handleFoundIndexPositional(
2624 OpCodeMapPositionType startOpPos)
const;
2632 OpCodeMapPositionType opPos)
const;
2651 const Locator* m_locator;
2658 bool m_inStylesheet;
2665 static FunctionTableType s_functions;
2672 XALAN_CPP_NAMESPACE_END
2676 #endif // XPATH_HEADER_GUARD_1357924680
void execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, XalanDOMString &result) const
Execute the XPath from the provided context.
void shrink()
Shrink internal tables.
XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType
const XObjectPtr execute(XPathExecutionContext &executionContext) const
Execute the XPath from the provided context.
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, double &result) const
Execute the XPath from the provided context.
TokenQueueSizeType TokenQueuePositionType
static void installFunction(const XalanDOMString &funcName, const Function &func)
Install a built-in function.
double functionPosition(XalanNode *context, XPathExecutionContext &executionContext) const
Handle the built-in function "position".
const XObjectPtr execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext) const
Execute the XPath from the provided context.
Local implementation of MutableNodeRefList.
void setInStylesheet(bool fValue)
static double getNegativeInfinity()
Double value that represents negative infinity.
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, double &theResult) const
Execute an expression as a group.
const XObjectPtr extfunction(XalanNode *context, OpCodeMapPositionType, const XalanDOMString &theNamespace, const XalanDOMString &functionName, const Function::XObjectArgVectorType &argVec, XPathExecutionContext &executionContext) const
Handle an extension function.
virtual const PrefixResolver * getPrefixResolver() const =0
Retrieve the resolver for namespaces.
XPathExpression::OpCodeMapPositionType OpCodeMapPositionType
bool functionBoolean(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "boolean".
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, XalanDOMString &theResult) const
Execute an expression as a group.
XPathExpression & getExpression()
Retrieve a reference to the current expression.
XPathExpression::TokenQueuePositionType TokenQueuePositionType
void setLocator(const Locator *theLocator)
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) 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.
eTargetType getTargetType() const
Class to hold XObjectPtr return types.
static void getInstalledFunctionNames(OutputIteratorType theIterator)
Add the names for the installed functions to a vector strings.
Class defines a table of functions that can be called in XPath expresions.
MemoryManager & getMemoryManager()
TargetData(const XalanDOMChar *theString, eMatchScore thePriority, eTargetType theTargetType)
eMatchScore operator()(const XalanElement &context) const
void execute(XPathExecutionContext &executionContext, XalanDOMString &result) const
Execute the XPath from the provided context.
static bool uninstallFunction(const XalanDOMChar *funcName)
Remove a named function from the function table.
XPathExecutionContext::CurrentNodePushAndPop CurrentNodePushAndPop
eMatchScore getDefaultPriority() const
static const FunctionTableType & getFunctionTable()
Retrieve the table of installed functions.
Local implementation of NodeRefList.
static void installFunction(const XalanDOMChar *funcName, const Function &func)
Install a built-in function.
void locationPath(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, MutableNodeRefList &theResult) const
Execute a location path.
void addNodesInDocOrder(const XalanNodeList &nodelist, XPathExecutionContext &executionContext)
Copy NodeList members into this nodelist, adding in document order.
virtual NodeType getNodeType() const =0
An enum value representing the type of the underlying object.
const XObjectPtr execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, MutableNodeRefList &result) const
Execute the XPath from the provided context.
bool getInStylesheet() const
static bool uninstallFunction(const XalanDOMString &funcName)
Remove a named function from the function table.
XPathExecutionContext::GetCachedString GetCachedString
const XObjectPtr predicate(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Evaluate a predicate.
virtual size_type getContextNodeListLength() const =0
XPathExecutionContext::PrefixResolverSetAndRestore PrefixResolverSetAndRestore
static const XalanDOMString & getNameOfNode(const XalanNode &n)
Retrieve the name of the node, taking into account the differences between the DOM and XSLT data mode...
const XObjectPtr group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Execute an expression as a group.
void execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute the XPath from the provided context.
XObjectPtr execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, MutableNodeRefList &result) const
Execute the XPath from the provided context.
double functionLast(XPathExecutionContext &executionContext) const
Handle the built-in function "last".
static double getMatchScoreValue(eMatchScore score)
virtual XalanNode * getCurrentNode() const =0
Retrieve the node currently being executed.
This class defines an interface for classes that resolve namespace prefixes to their URIs...
Class to hold XPath return types.
const Locator * getLocator() const
void execute(XPathExecutionContext &executionContext, bool &result) const
Execute the XPath from the provided context.
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute an expression as a group.
eMatchScore operator()(const XalanNode &context, XalanNode::NodeType nodeType) const
const XalanDOMString & functionName(XalanNode *context) const
Handle the built-in function "name".
static void destroyTable()
static bool isInstalledFunction(const XalanDOMString &theFunctionName)
Whether the named function is installed in the function table.
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, bool &theResult) const
Execute an expression as a group.
static double floor(double theValue)
Returns the floor of a number according to the XPath rules.
NodeRefListBase::size_type size_type
double functionCeiling(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "ceiling".
NodeTester & operator=(const NodeTester &theRHS)
virtual const NodeRefListBase & nodeset() const
Cast result object to a nodelist.
bool operator==(const ElemAttributeSet &theLHS, const ElemAttributeSet &theRHS)
double functionNumber(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "number".
double functionFloor(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "floor".
static double round(double theValue)
Round a number according to the XPath rules.
static double number(bool theBoolean)
Static conversion function.
double functionNumber(XalanNode *context, XPathExecutionContext &executionContext) const
Handle the built-in function "number".
const XPathExpression & getExpression() const
Retrieve a reference to the current expression.
XPathFunctionTable FunctionTableType
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, MutableNodeRefList &theResult) const
Execute an expression as a group.
void execute(XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute the XPath from the provided context.
virtual size_type getContextNodeListPosition(const XalanNode &contextNode) const =0
const XObjectPtr execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext) const
Execute the XPath from the provided context.
[OP_XPATH] [length] {expression}
#define XALAN_XPATH_EXPORT
bool functionNot(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "not".
OpCodeMapType::const_iterator OpCodeMapPositionType
void setDocumentOrder()
Set the known order of the nodes.
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, double &result) const
Execute the XPath from the provided context.
OpCodeMapType::value_type OpCodeMapValueType
XalanVector< TargetData > TargetDataVectorType
void execute(XPathExecutionContext &executionContext, double &result) const
Execute the XPath from the provided context.
XPathExpression::OpCodeMapValueType OpCodeMapValueType
double functionRound(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "round".
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, XalanDOMString &result) const
Execute the XPath from the provided context.
static double ceiling(double theValue)
Returns the ceiling of a number according to the XPath rules.
const XObjectPtr execute(XPathExecutionContext &executionContext, MutableNodeRefList &result) const
Execute the XPath from the provided context.
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, bool &result) const
Execute the XPath from the provided context.
const XalanDOMChar * getString() const