Xalan-C++ API Reference 1.12.0
XPath.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18#if !defined(XPATH_HEADER_GUARD_1357924680)
19#define XPATH_HEADER_GUARD_1357924680
20
21
22
23// Base header file. Must be first.
25
26
27
29
30
31
33
34
35
36// Base class header files...
38
39
40
45
46
47
48namespace XERCES_CPP_NAMESPACE
49{
50 class Locator;
51}
52
53
54
55namespace XALAN_CPP_NAMESPACE {
56
57
58
59class PrefixResolver;
60class XObject;
61class XalanElement;
62class XalanNode;
63class XPathConstructionContext;
64
65
66
68{
69public:
70
71 typedef xercesc::Locator LocatorType;
72
79
80
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[];
88
97
99 {
100 public:
101
102 enum eTargetType { eAttribute, eElement, eAny, eOther };
103
105 m_string(0),
106 m_priority(eMatchScoreNone),
107 m_targetType(eOther)
108 {
109 }
110
112 const XalanDOMChar* theString,
115 m_string(theString),
116 m_priority(thePriority),
117 m_targetType(theTargetType)
118 {
119 }
120
121 const XalanDOMChar*
122 getString() const
123 {
124 return m_string;
125 }
126
129 {
130 return m_priority;
131 }
132
133 eTargetType
135 {
136 return m_targetType;
137 }
138
139 private:
140
141 const XalanDOMChar* m_string;
142
143 eMatchScore m_priority;
144
145 eTargetType m_targetType;
146 };
147
149
150 /**
151 * Perform static initialization. See class XPathInit.
152 */
153 static void
154 initialize(MemoryManager& theManager);
155
156 /**
157 * Perform static shut down. See class XPathInit.
158 */
159 static void
161
162 /**
163 * Construct an XPath.
164 *
165 * @param theLocator The applicable Locator, if any.
166 */
167 explicit
169 MemoryManager& theManager,
170 const Locator* theLocator = 0);
171
172 static XPath*
174 MemoryManager& theManager,
175 const Locator* theLocator = 0);
176
177 MemoryManager&
179 {
180 return m_expression.getMemoryManager();
181 }
182
184
185 /**
186 * Shrink internal tables.
187 */
188 void
190 {
191 m_expression.shrink();
192 }
193
194 /**
195 * Execute the XPath from the provided context.
196 *
197 * @param context current source tree context node, which must not be 0
198 * @param prefixResolver prefix resolver to use
199 * @param executionContext current execution context
200 * @return smart-pointer to result XObject
201 */
202 const XObjectPtr
207
208 /**
209 * Execute the XPath from the provided context.
210 *
211 * @param context current source tree context node, which must not be 0
212 * @param prefixResolver prefix resolver to use
213 * @param executionContext current execution context
214 * @param result the boolean result
215 */
216 void
221 bool& result) const;
222
223 /**
224 * Execute the XPath from the provided context.
225 *
226 * @param context current source tree context node, which must not be 0
227 * @param prefixResolver prefix resolver to use
228 * @param executionContext current execution context
229 * @param result the numeric result
230 */
231 void
236 double& result) const;
237
238 /**
239 * Execute the XPath from the provided context. The
240 * result is appended to the supplied string.
241 *
242 * @param context current source tree context node, which must not be 0
243 * @param prefixResolver prefix resolver to use
244 * @param executionContext current execution context
245 * @param result the string result
246 */
247 void
252 XalanDOMString& result) const;
253
255
256 /**
257 * Execute the XPath from the provided context.
258 *
259 * @param context current source tree context node, which must not be 0
260 * @param prefixResolver prefix resolver to use
261 * @param executionContext current execution context
262 * @param formatterListener the FormatterListener instance to receive the result
263 * @param function A pointer to the member function of FormatterListener to call
264 */
265 void
271 MemberFunctionPtr function) const;
272
273 /**
274 * Execute the XPath from the provided context. Normally,
275 * the expression will be evaluated and the result placed
276 * in the parameter result. However, some cases (such as
277 * the evalution of a variable) could result in the copying
278 * of a node-set, which is extremely expensive. In that
279 * case, the return value will contain the result of the
280 * evaluation. If the call to XObject::null() on the return
281 * value is true, that indicates the value was executed
282 * directly into the parameter. Otherwise, the parameter
283 * will be empty, and the result will be in the XObject
284 * instance returned.
285 *
286 * @param context current source tree context node, which must not be 0
287 * @param prefixResolver prefix resolver to use
288 * @param executionContext current execution context
289 * @param result the node-set result
290 * @return the node-set result, if the result was not returned in the parameter
291 */
292 const XObjectPtr
298
299 /**
300 * Execute the XPath from the provided context.
301 *
302 * @param context current source tree context node, which must not be 0
303 * @param prefixResolver prefix resolver to use
304 * @param contextNodeList node list for current context
305 * @param executionContext current execution context
306 * @return smart-pointer to result XObject
307 */
308 const XObjectPtr
322
323 /**
324 * Execute the XPath from the provided context.
325 *
326 * @param context current source tree context node, which must not be 0
327 * @param prefixResolver prefix resolver to use
328 * @param contextNodeList node list for current context
329 * @param executionContext current execution context
330 * @param result the boolean result
331 */
332 void
347
348 /**
349 * Execute the XPath from the provided context.
350 *
351 * @param context current source tree context node, which must not be 0
352 * @param prefixResolver prefix resolver to use
353 * @param contextNodeList node list for current context
354 * @param executionContext current execution context
355 * @param result the numeric result
356 */
357 void
372
373 /**
374 * Execute the XPath from the provided context. The
375 * result is appended to the supplied string.
376 *
377 * @param context current source tree context node, which must not be 0
378 * @param prefixResolver prefix resolver to use
379 * @param contextNodeList node list for current context
380 * @param executionContext current execution context
381 * @param result the string result
382 */
383 void
398
399 /**
400 * Execute the XPath from the provided context.
401 *
402 * @param context current source tree context node, which must not be 0
403 * @param prefixResolver prefix resolver to use
404 * @param contextNodeList node list for current context
405 * @param executionContext current execution context
406 * @param formatterListener the FormatterListener instance to receive the result
407 * @param function A pointer to the member function of FormatterListener to call
408 */
409 void
416 MemberFunctionPtr function) const
417 {
418 // Push and pop the context node list...
422
424 }
425
426 /**
427 * Execute the XPath from the provided context. Normally,
428 * the expression will be evaluated and the result placed
429 * in the parameter result. However, some cases (such as
430 * the evalution of a variable) could result in the copying
431 * of a node-set, which is extremely expensive. In that
432 * case, the return value will contain the result of the
433 * evaluation. If the call to XObject::null() on the return
434 * value is true, that indicates the value was executed
435 * directly into the parameter. Otherwise, the parameter
436 * will be empty, and the result will be in the XObject
437 * instance returned.
438 *
439 * @param context current source tree context node, which must not be 0
440 * @param prefixResolver prefix resolver to use
441 * @param contextNodeList node list for current context
442 * @param executionContext current execution context
443 * @param result the result as a set of nodes
444 * @return the node-set result, if the result was not returned in the parameter
445 */
446 const XObjectPtr
461
462 /**
463 * Execute the XPath from the provided context.
464 *
465 * The prefix resolver and current node must already
466 * be set execution context, and must not be 0.
467 *
468 * @param executionContext current execution context
469 * @return smart-pointer to result XObject
470 */
471 const XObjectPtr
473 {
474 assert(executionContext.getCurrentNode() != 0);
475 assert(executionContext.getPrefixResolver() != 0);
476
477 return executeMore(
478 executionContext.getCurrentNode(),
479 getInitialOpCodePosition(),
481 }
482
483 /**
484 * Execute the XPath from the provided context.
485 *
486 * The prefix resolver and current node must already
487 * be set execution context, and must not be 0.
488 *
489 * @param executionContext current execution context
490 * @param result the boolean result
491 */
492 void
495 bool& result) const
496 {
497 assert(executionContext.getCurrentNode() != 0);
498 assert(executionContext.getPrefixResolver() != 0);
499
500 executeMore(
501 executionContext.getCurrentNode(),
502 getInitialOpCodePosition(),
504 result);
505 }
506
507 /**
508 * Execute the XPath from the provided context.
509 *
510 * The prefix resolver must already be set in the
511 * execution context.
512 *
513 * @param executionContext current execution context
514 * @param result the numeric result
515 */
516 void
519 double& result) const
520 {
521 assert(executionContext.getCurrentNode() != 0);
522 assert(executionContext.getPrefixResolver() != 0);
523
524 executeMore(
525 executionContext.getCurrentNode(),
526 getInitialOpCodePosition(),
528 result);
529 }
530
531 /**
532 * Execute the XPath from the provided context. The
533 * result is appended to the supplied string.
534 *
535 * The prefix resolver and current node must already
536 * be set execution context, and must not be 0.
537 *
538 * @param executionContext current execution context
539 * @param result the string result
540 */
541 void
544 XalanDOMString& result) const
545 {
546 assert(executionContext.getCurrentNode() != 0);
547 assert(executionContext.getPrefixResolver() != 0);
548
549 executeMore(
550 executionContext.getCurrentNode(),
551 getInitialOpCodePosition(),
553 result);
554 }
555
556 /**
557 * Execute the XPath from the provided context.
558 *
559 * The prefix resolver and current node must already
560 * be set execution context, and must not be 0.
561 *
562 * @param executionContext current execution context
563 * @param formatterListener the FormatterListener instance to receive the result
564 * @param function A pointer to the member function of FormatterListener to call
565 */
566 void
570 MemberFunctionPtr function) const
571 {
572 assert(executionContext.getCurrentNode() != 0);
573 assert(executionContext.getPrefixResolver() != 0);
574
575 executeMore(
576 executionContext.getCurrentNode(),
577 getInitialOpCodePosition(),
580 function);
581 }
582
583 /**
584 * Execute the XPath from the provided context. Normally,
585 * the expression will be evaluated and the result placed
586 * in the parameter result. However, some cases (such as
587 * the evalution of a variable) could result in the copying
588 * of a node-set, which is extremely expensive. In that
589 * case, the return value will contain the result of the
590 * evaluation. If the call to XObject::null() on the return
591 * value is true, that indicates the value was executed
592 * directly into the parameter. Otherwise, the parameter
593 * will be empty, and the result will be in the XObject
594 * instance returned.
595 *
596 * The prefix resolver and current node must already
597 * be set execution context, and must not be 0.
598 *
599 * @param executionContext current execution context
600 * @param result A node list for the result. This may or may not contain the actual result.
601 * @return the node-set result, if the result was not returned in the parameter
602 */
603 const XObjectPtr
607 {
608 assert(executionContext.getCurrentNode() != 0);
609 assert(executionContext.getPrefixResolver() != 0);
610
611 return executeMore(
612 executionContext.getCurrentNode(),
613 getInitialOpCodePosition(),
615 result);
616 }
617
618 /**
619 * Execute the XPath from the provided context.
620 *
621 * The current node must already be set execution context,
622 * and must not be 0.
623 *
624 * @param executionContext current execution context
625 * @param prefixResolver prefix resolver to use
626 * @return smart-pointer to result XObject
627 */
628 const XObjectPtr
632 {
633 assert(executionContext.getCurrentNode() != 0);
634
635 // Push and pop the PrefixResolver...
639
640 return executeMore(
641 executionContext.getCurrentNode(),
642 getInitialOpCodePosition(),
644 }
645
646 /**
647 * Execute the XPath from the provided context.
648 *
649 * The current node must already be set execution context,
650 * and must not be 0.
651 *
652 * @param executionContext current execution context
653 * @param prefixResolver prefix resolver to use
654 * @param result the boolean result
655 */
656 void
660 bool& result) const
661 {
662 assert(executionContext.getCurrentNode() != 0);
663
664 // Push and pop the PrefixResolver...
668
669 executeMore(
670 executionContext.getCurrentNode(),
671 getInitialOpCodePosition(),
673 result);
674 }
675
676 /**
677 * Execute the XPath from the provided context.
678 *
679 * The current node must already be set execution context,
680 * and must not be 0.
681 *
682 * @param executionContext current execution context
683 * @param prefixResolver prefix resolver to use
684 * @param result the numeric result
685 */
686 void
690 double& result) const
691 {
692 assert(executionContext.getCurrentNode() != 0);
693
694 // Push and pop the PrefixResolver...
698
699 executeMore(
700 executionContext.getCurrentNode(),
701 getInitialOpCodePosition(),
703 result);
704 }
705
706 /**
707 * Execute the XPath from the provided context. The
708 * result is appended to the supplied string.
709 *
710 * The current node must already be set execution context,
711 * and must not be 0.
712 *
713 * @param executionContext current execution context
714 * @param prefixResolver prefix resolver to use
715 * @param result the string result
716 */
717 void
721 XalanDOMString& result) const
722 {
723 assert(executionContext.getCurrentNode() != 0);
724
725 // Push and pop the PrefixResolver...
729
730 executeMore(
731 executionContext.getCurrentNode(),
732 getInitialOpCodePosition(),
734 result);
735 }
736
737 /**
738 * Execute the XPath from the provided context.
739 *
740 * @param prefixResolver prefix resolver to use
741 * @param executionContext current execution context
742 * @param formatterListener the FormatterListener instance to receive the result
743 * @param function A pointer to the member function of FormatterListener to call
744 */
745 void
750 MemberFunctionPtr function) const
751 {
752 assert(executionContext.getCurrentNode() != 0);
753
754 // Push and pop the PrefixResolver...
758
759 executeMore(
760 executionContext.getCurrentNode(),
761 getInitialOpCodePosition(),
764 function);
765 }
766
767 /**
768 * Execute the XPath from the provided context. Normally,
769 * the expression will be evaluated and the result placed
770 * in the parameter result. However, some cases (such as
771 * the evalution of a variable) could result in the copying
772 * of a node-set, which is extremely expensive. In that
773 * case, the return value will contain the result of the
774 * evaluation. If the call to XObject::null() on the return
775 * value is true, that indicates the value was executed
776 * directly into the parameter. Otherwise, the parameter
777 * will be empty, and the result will be in the XObject
778 * instance returned.
779 *
780 * The current node must already be set execution context,
781 * and must not be 0.
782 *
783 * @param executionContext current execution context
784 * @param prefixResolver prefix resolver to use
785 * @param result A node list for the result. This may or may not contain the actual result.
786 * @return the node-set result, if the result was not returned in the parameter
787 */
793 {
794 assert(executionContext.getCurrentNode() != 0);
795
796 // Push and pop the PrefixResolver...
800
801 return executeMore(
802 executionContext.getCurrentNode(),
803 getInitialOpCodePosition(),
805 result);
806 }
807
808 /**
809 * Retrieve a reference to the current expression.
810 *
811 * @return current expression
812 */
815 {
816 return m_expression;
817 }
818
819 /**
820 * Retrieve a reference to the current expression.
821 *
822 * @return current expression
823 */
824 const XPathExpression&
826 {
827 return m_expression;
828 }
829
830 static double
832 {
833 switch(score)
834 {
835 case eMatchScoreNone:
836 return DoubleSupport::getNegativeInfinity();
837 break;
838
839 case eMatchScoreNodeTest:
840 return -0.5;
841 break;
842
843 case eMatchScoreNSWild:
844 return -0.25;
845 break;
846
847 case eMatchScoreOther:
848 return 0.5;
849 break;
850
851 case eMatchScoreQName:
852 return 0.0;
853 break;
854 };
855
856 assert(false);
857 return 0.0;
858 }
859
860 /**
861 * Get the match score for the specified node.
862 *
863 * @param node The node for the score
864 * @param executionContext current execution context
865 * @return union of node-set operands
866 */
867 eMatchScore
869 XalanNode* node,
871
872 /**
873 * Get the match score for the specified node.
874 *
875 * @param node The node for the score
876 * @param resolver The prefix resolver
877 * @param executionContext current execution context
878 * @return union of node-set operands
879 */
882 XalanNode* node,
885
886 /**
887 * Evaluate a predicate.
888 *
889 * @param context current source tree context node
890 * @param opPos current position in the Op Map
891 * @param executionContext current execution context
892 * @return pointer to either a boolean or a number
893 */
894 const XObjectPtr
902
903 /**
904 * Add the data for the target of match pattern to a vector.
905 *
906 * @param targetData The vector for the data
907 */
908 void
910
911 /**
912 * Install a built-in function.
913 *
914 * @param funcName unqualified name of the function
915 * @param func instance of an XPath function object
916 */
917 static void
920 const Function& func)
921 {
922 s_functions.InstallFunction(funcName,
923 func);
924 }
925
926 /**
927 * Install a built-in function.
928 *
929 * @param funcName unqualified name of the function
930 * @param func instance of an XPath function object
931 */
932 static void
934 const XalanDOMChar* funcName,
935 const Function& func)
936 {
937 s_functions.InstallFunction(funcName,
938 func);
939 }
940
941 /**
942 * Remove a named function from the function table.
943 *
944 * @param funcName name of function
945 * @return true if the function was found and removed.
946 */
947 static bool
949 {
950 return s_functions.UninstallFunction(funcName);
951 }
952
953 /**
954 * Remove a named function from the function table.
955 *
956 * @param funcName name of function
957 * @return true if the function was found and removed.
958 */
959 static bool
961 {
962 return s_functions.UninstallFunction(funcName);
963 }
964
965 /**
966 * Whether the named function is installed in the function table.
967 *
968 * @param name of function
969 * @return true if the function has been installed
970 */
971 static bool
972 isInstalledFunction(const XalanDOMString& theFunctionName)
973 {
974 return s_functions.isInstalledFunction(theFunctionName);
975 }
976
978
979 /**
980 * Retrieve the table of installed functions.
981 *
982 * @return function table
983 */
984 static const FunctionTableType&
986 {
987 return s_functions;
988 }
989
990 /**
991 * Add the names for the installed functions to a vector strings.
992 *
993 * @param theIterator vector added to
994 */
995 template<class OutputIteratorType>
996 static void
998 {
999 s_functions.getInstalledFunctionNames(theIterator);
1000 }
1001
1002 static void
1004 {
1005 s_functions.DestroyTable();
1006 }
1007
1008 bool
1010 {
1011 return m_inStylesheet;
1012 }
1013
1014 void
1016 {
1017 m_inStylesheet = fValue;
1018 }
1019
1020 const Locator*
1022 {
1023 return m_locator;
1024 }
1025
1026 void
1027 setLocator(const Locator* theLocator)
1028 {
1029 m_locator = theLocator;
1030 }
1031
1033 {
1034 public:
1035
1037
1039
1041 const XPath& xpath,
1046
1051 const Locator* theLocator = 0,
1053
1058
1061 const XalanNode& context,
1063 {
1064 assert(context.getNodeType() == nodeType);
1065
1066 return (this->*m_testFunction)(context, nodeType);
1067 }
1068
1071 {
1072 return (this->*m_testFunction2)(context);
1073 }
1074
1075 NodeTester&
1077 {
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;
1083
1084 return *this;
1085 }
1086
1087 protected:
1088
1094 const Locator* theLocator);
1095
1100
1101 private:
1102
1103
1104 typedef eMatchScore (NodeTester::*TestFunctionPtr)(const XalanNode&, XalanNode::NodeType) const;
1105 typedef eMatchScore (NodeTester::*TestFunctionPtr2)(const XalanElement&) const;
1106
1107
1109 testComment(
1110 const XalanNode& context,
1112
1114 testText(
1115 const XalanNode& context,
1117
1119 testPI(
1120 const XalanNode& context,
1122
1124 testPIName(
1125 const XalanNode& context,
1127
1129 testNode(
1130 const XalanNode& context,
1132
1134 testRoot(
1135 const XalanNode& context,
1137
1139 testAttributeNCName(
1140 const XalanNode& context,
1142
1144 testAttributeQName(
1145 const XalanNode& context,
1147
1149 testAttributeNamespaceOnly(
1150 const XalanNode& context,
1152
1154 testAttributeTotallyWild(
1155 const XalanNode& context,
1157
1159 testElementNCName(
1160 const XalanNode& context,
1162
1164 testElementQName(
1165 const XalanNode& context,
1167
1169 testElementNamespaceOnly(
1170 const XalanNode& context,
1172
1174 testElementTotallyWild(
1175 const XalanNode& context,
1177
1179 testElementNCName2(const XalanElement& context) const;
1180
1182 testElementQName2(const XalanElement& context) const;
1183
1185 testElementNamespaceOnly2(const XalanElement& context) const;
1186
1188 testElementTotallyWild2(const XalanElement& context) const;
1189
1191 testNamespaceNCName(
1192 const XalanNode& context,
1194
1196 testNamespaceTotallyWild(
1197 const XalanNode& context,
1199
1201 testDefault(
1202 const XalanNode& context,
1204
1206 testDefault2(const XalanElement& context) const;
1207
1208 bool
1209 matchLocalName(const XalanNode& context) const;
1210
1211 bool
1212 matchNamespaceURI(const XalanNode& context) const;
1213
1214 bool
1215 matchLocalNameAndNamespaceURI(const XalanNode& context) const;
1216
1217 bool
1218 matchNamespace(const XalanNode& context) const;
1219
1220 bool
1221 shouldStripSourceNode(const XalanText& context) const;
1222
1223 // Data members...
1224 XPathExecutionContext* m_executionContext;
1225
1226 const XalanDOMString* m_targetNamespace;
1227
1228 const XalanDOMString* m_targetLocalName;
1229
1230 TestFunctionPtr m_testFunction;
1231
1232 TestFunctionPtr2 m_testFunction2;
1233 };
1234
1235 friend class NodeTester;
1236
1237protected:
1238
1239 /**
1240 * Execute a location path.
1241 *
1242 * @param context current source tree context node
1243 * @param opPos current position in the Op Mpa
1244 * @param executionContext current execution context
1245 * @return node-set
1246 */
1247 const XObjectPtr
1252
1253 /**
1254 * Execute a location path.
1255 *
1256 * @param context current source tree context node
1257 * @param opPos current position in the Op Map
1258 * @param executionContext current execution context
1259 * @param theResult the result as a node list
1260 */
1261 void
1266 bool& theResult) const;
1267
1268 /**
1269 * Execute a location path.
1270 *
1271 * @param context current source tree context node
1272 * @param opPos current position in the Op Map
1273 * @param executionContext current execution context
1274 * @param theResult the result as a node list
1275 */
1276 void
1281 double& theResult) const;
1282
1283 /**
1284 * Execute a location path.
1285 *
1286 * @param context current source tree context node
1287 * @param opPos current position in the Op Map
1288 * @param executionContext current execution context
1289 * @param theResult the result as a node list
1290 */
1291 void
1296 XalanDOMString& theResult) const;
1297
1298 /**
1299 * Execute a location path.
1300 *
1301 * @param context current source tree context node
1302 * @param opPos current position in the Op Map
1303 * @param executionContext current execution context
1304 * @param formatterListener the FormatterListener instance to receive the result
1305 * @param function A pointer to the member function of FormatterListener to call
1306 */
1307 void
1313 MemberFunctionPtr function) const;
1314
1315 /**
1316 * Execute a location path.
1317 *
1318 * @param context current source tree context node
1319 * @param opPos current position in the Op Map
1320 * @param executionContext current execution context
1321 * @param theResult the result as a node list
1322 */
1323 void
1332
1333 /**
1334 * Execute the XPath from the provided context.
1335 *
1336 * @param context current source tree context node
1337 * @param opPos current position in the Op Map
1338 * @param executionContext current execution context
1339 * @return pointer to union of node-set operands
1340 */
1341 const XObjectPtr
1346
1347 /**
1348 * Execute the XPath from the provided context.
1349 *
1350 * @param context current source tree context node
1351 * @param opPos current position in the Op Map
1352 * @param executionContext current execution context
1353 * @param theResult The result of the execution
1354 */
1355 void
1360 bool& theResult) const;
1361
1362 /**
1363 * Execute the XPath from the provided context.
1364 *
1365 * @param context current source tree context node
1366 * @param opPos current position in the Op Map
1367 * @param executionContext current execution context
1368 * @param theResult The result of the execution
1369 */
1370 void
1375 double& theResult) const;
1376
1377 /**
1378 * Execute the XPath from the provided context. The result
1379 * is appended to the supplied string.
1380 *
1381 * @param context current source tree context node
1382 * @param opPos current position in the Op Map
1383 * @param executionContext current execution context
1384 * @param theResult The result of the execution
1385 */
1386 void
1391 XalanDOMString& theResult) const;
1392
1393 /**
1394 * Execute the XPath from the provided context.
1395 *
1396 * @param context current source tree context node
1397 * @param opPos current position in the Op Map
1398 * @param executionContext current execution context
1399 * @param formatterListener the FormatterListener instance to receive the result
1400 * @param function A pointer to the member function of FormatterListener to call
1401 */
1402 void
1408 MemberFunctionPtr function) const;
1409
1410 /**
1411 * Execute the XPath from the provided context.
1412 *
1413 * @param context current source tree context node
1414 * @param opPos current position in the Op Map
1415 * @param executionContext current execution context
1416 * @param theResult The result of the execution
1417 * @return the node-set result, if the result was not returned in the parameter
1418 */
1419 const XObjectPtr
1425
1426 /**
1427 * Helper function to get match score.
1428 * @param context The current source tree context node.
1429 * @param executionContext The current execution context
1430 * @param score The match score
1431 */
1432 void
1436 eMatchScore& score) const;
1437
1438 /**
1439 * OR two expressions and return the boolean result.
1440 * @param context The current source tree context node.
1441 * @param opPos The current position in the Op Map.
1442 * @param executionContext current execution context
1443 * @return true if the one of the two arguments are true.
1444 */
1445 bool
1450
1451 /**
1452 * OR two expressions and return the boolean result.
1453 * @param context The current source tree context node.
1454 * @param opPos The current position in the Op Map.
1455 * @param executionContext current execution context
1456 * @return true if the two arguments are both true.
1457 */
1458 bool
1463
1464 /**
1465 * Tell if two expressions are functionally not equal.
1466 * @param context The current source tree context node.
1467 * @param opPos The current position in the Op Map.
1468 * @param executionContext current execution context
1469 * @return true if the two arguments are not equal.
1470 */
1471 bool
1476
1477 /**
1478 * Tell if two expressions are functionally equal.
1479 * @param context The current source tree context node.
1480 * @param opPos The current position in the Op Map.
1481 * @param executionContext current execution context
1482 * @return true if the two arguments are equal.
1483 */
1484 bool
1489
1490 /**
1491 * Tell if one argument is less than or equal to the other argument.
1492 * @param context The current source tree context node.
1493 * @param opPos The current position in the Op Map.
1494 * @param executionContext current execution context
1495 * @return true if arg 1 is less than or equal to arg 2.
1496 */
1497 bool
1502
1503 /**
1504 * Tell if one argument is less than the other argument.
1505 * @param context The current source tree context node.
1506 * @param opPos The current position in the Op Map.
1507 * @param executionContext current execution context
1508 * @return true if arg 1 is less than arg 2.
1509 */
1510 bool
1515
1516 /**
1517 * Tell if one argument is greater than or equal to the other argument.
1518 * @param context The current source tree context node.
1519 * @param opPos The current position in the Op Map.
1520 * @param executionContext current execution context
1521 * @return true if arg 1 is greater than or equal to arg 2.
1522 */
1523 bool
1528
1529 /**
1530 * Tell if one argument is greater than the other argument.
1531 * @param context The current source tree context node.
1532 * @param opPos The current position in the Op Map.
1533 * @param executionContext current execution context
1534 * @return true if arg 1 is greater than arg 2.
1535 */
1536 bool
1541
1542 /**
1543 * Give the sum of two arguments.
1544 * @param context The current source tree context node.
1545 * @param opPos The current position in the Op Map.
1546 * @param executionContext current execution context
1547 * @return sum of arg1 and arg2.
1548 */
1549 double
1554
1555 /**
1556 * Give the sum of two arguments.
1557 * @param context The current source tree context node.
1558 * @param opPos The current position in the Op Map.
1559 * @param executionContext current execution context
1560 * @param formatterListener the FormatterListener instance to receive the result
1561 * @param function A pointer to the member function of FormatterListener to call
1562 */
1563 void
1569 MemberFunctionPtr function) const;
1570
1571 /**
1572 * Give the difference of two arguments.
1573 * @param context The current source tree context node.
1574 * @param opPos The current position in the Op Map.
1575 * @param executionContext current execution context
1576 * @return difference of arg1 and arg2.
1577 */
1578 double
1583
1584 /**
1585 * Give the difference of two arguments.
1586 * @param context The current source tree context node.
1587 * @param opPos The current position in the Op Map.
1588 * @param executionContext current execution context
1589 * @param formatterListener the FormatterListener instance to receive the result
1590 * @param function A pointer to the member function of FormatterListener to call
1591 */
1592 void
1598 MemberFunctionPtr function) const;
1599
1600 /**
1601 * Multiply two arguments.
1602 * @param context The current source tree context node.
1603 * @param opPos The current position in the Op Map.
1604 * @param executionContext current execution context
1605 * @return arg1 * arg2.
1606 */
1607 double
1612
1613 /**
1614 * Multiply two arguments.
1615 * @param context The current source tree context node.
1616 * @param opPos The current position in the Op Map.
1617 * @param executionContext current execution context
1618 * @param formatterListener the FormatterListener instance to receive the result
1619 * @param function A pointer to the member function of FormatterListener to call
1620 */
1621 void
1627 MemberFunctionPtr function) const;
1628
1629 /**
1630 * Divide a number.
1631 * @param context The current source tree context node.
1632 * @param opPos The current position in the Op Map.
1633 * @param executionContext current execution context
1634 * @return arg1 / arg2.
1635 */
1636 double
1641
1642 /**
1643 * Divide a number.
1644 * @param context The current source tree context node.
1645 * @param opPos The current position in the Op Map.
1646 * @param executionContext current execution context
1647 * @param formatterListener the FormatterListener instance to receive the result
1648 * @param function A pointer to the member function of FormatterListener to call
1649 */
1650 void
1656 MemberFunctionPtr function) const;
1657
1658 /**
1659 * Return the remainder from a truncating division.
1660 * @param context The current source tree context node.
1661 * @param opPos The current position in the Op Map.
1662 * @param executionContext current execution context
1663 * @return arg1 mod arg2.
1664 */
1665 double
1670
1671 /**
1672 * Return the remainder from a truncating division.
1673 * @param context The current source tree context node.
1674 * @param opPos The current position in the Op Map.
1675 * @param executionContext current execution context
1676 * @param formatterListener the FormatterListener instance to receive the result
1677 * @param function A pointer to the member function of FormatterListener to call
1678 */
1679 void
1685 MemberFunctionPtr function) const;
1686
1687 /**
1688 * Return the negation of a number.
1689 * @param context The current source tree context node.
1690 * @param opPos The current position in the Op Map.
1691 * @param executionContext current execution context
1692 * @return -arg.
1693 */
1694 double
1699
1700 /**
1701 * Return the negation of a number.
1702 * @param context The current source tree context node.
1703 * @param opPos The current position in the Op Map.
1704 * @param executionContext current execution context
1705 * @param formatterListener the FormatterListener instance to receive the result
1706 * @param function A pointer to the member function of FormatterListener to call
1707 */
1708 void
1714 MemberFunctionPtr function) const;
1715
1716 /**
1717 * Computes the union of its operands which must be node-sets.
1718 * @param context The current source tree context node.
1719 * @param opPos The current position in the Op Map.
1720 * @param executionContext current execution context
1721 * @return the union of node-set operands.
1722 */
1723 const XObjectPtr
1728
1729 /**
1730 * Computes the union of its operands which must be node-sets.
1731 *
1732 * @param context The current source tree context node.
1733 * @param opPos The current position in the Op Map.
1734 * @param executionContext current execution context
1735 * @result the result of the union of node-set operands.
1736 */
1737 void
1742 bool& result) const;
1743
1744 /**
1745 * Computes the union of its operands which must be node-sets.
1746 *
1747 * @param context The current source tree context node.
1748 * @param opPos The current position in the Op Map.
1749 * @param executionContext current execution context
1750 * @result the result of the union of node-set operands.
1751 */
1752 void
1757 double& result) const;
1758
1759 /**
1760 * Computes the union of its operands which must be node-sets.
1761 *
1762 * @param context The current source tree context node.
1763 * @param opPos The current position in the Op Map.
1764 * @param executionContext current execution context
1765 * @result the result of the union of node-set operands.
1766 */
1767 void
1772 XalanDOMString& result) const;
1773
1774 /**
1775 * Computes the union of its operands which must be node-sets.
1776 *
1777 * @param context The current source tree context node.
1778 * @param opPos The current position in the Op Map.
1779 * @param executionContext current execution context
1780 * @param formatterListener the FormatterListener instance to receive the result
1781 * @param function A pointer to the member function of FormatterListener to call
1782 */
1783 void
1789 MemberFunctionPtr function) const;
1790
1791 /**
1792 * Computes the union of its operands which must be node-sets.
1793 * @param context The current source tree context node.
1794 * @param opPos The current position in the Op Map.
1795 * @param executionContext current execution context
1796 * @result the result of the union of node-set operands.
1797 */
1798 void
1803 MutableNodeRefList& result) const;
1804
1805 /**
1806 * Get a literal value.
1807 * @param opPos The current position in the Op Map.
1808 * @param executionContext current execution context
1809 * @return an XObject object.
1810 */
1811 const XObjectPtr
1815
1816 /**
1817 * Get a literal value as a boolean.
1818 *
1819 * @param opPos The current position in the Op Map.
1820 * @param theResult The value.
1821 */
1822 void
1825 bool& theResult) const;
1826
1827 /**
1828 * Get a literal value as a number.
1829 *
1830 * @param opPos The current position in the Op Map.
1831 * @param theResult The value.
1832 */
1833 void
1836 double& theResult) const;
1837
1838 /**
1839 * Get a literal value. The value is appended to the
1840 * supplied string.
1841 *
1842 * @param opPos The current position in the Op Map.
1843 * @param theResult The string.
1844 */
1845 void
1848 XalanDOMString& theResult) const;
1849
1850 /**
1851 * Get a literal value.
1852 * @param opPos The current position in the Op Map.
1853 * @param executionContext current execution context
1854 * @return The result as a double.
1855 */
1856 void
1860 MemberFunctionPtr function) const;
1861
1862 /**
1863 * Get the value of a variable.
1864 * @param opPos The current position in the Op Map.
1865 * @param executionContext current execution context
1866 * @return an XObject object.
1867 */
1868 const XObjectPtr
1872
1873 /**
1874 * Execute an expression as a group.
1875 * @param context The current source tree context node.
1876 * @param opPos The current position in the Op Map.
1877 * @param executionContext current execution context
1878 * @return arg.
1879 */
1880 const XObjectPtr
1885 {
1886 return executeMore(context, opPos + 2, executionContext);
1887 }
1888
1889 /**
1890 * Execute an expression as a group.
1891 * @param context The current source tree context node.
1892 * @param opPos The current position in the Op Map.
1893 * @param executionContext current execution context
1894 * @param theResult The result of the execution
1895 */
1896 void
1901 bool& theResult) const
1902 {
1903 executeMore(context, opPos + 2, executionContext, theResult);
1904 }
1905
1906 /**
1907 * Execute an expression as a group.
1908 * @param context The current source tree context node.
1909 * @param opPos The current position in the Op Map.
1910 * @param executionContext current execution context
1911 * @param theResult The result of the execution
1912 */
1913 void
1918 double& theResult) const
1919 {
1920 executeMore(context, opPos + 2, executionContext, theResult);
1921 }
1922
1923 /**
1924 * Execute an expression as a group.
1925 * @param context The current source tree context node.
1926 * @param opPos The current position in the Op Map.
1927 * @param executionContext current execution context
1928 * @param theResult The result of the execution
1929 */
1930 void
1939
1940 /**
1941 * Execute an expression as a group.
1942 *
1943 * @param context The current source tree context node.
1944 * @param opPos The current position in the Op Map.
1945 * @param executionContext current execution context
1946 * @param formatterListener the FormatterListener instance to receive the result
1947 * @param function A pointer to the member function of FormatterListener to call
1948 */
1949 void
1955 MemberFunctionPtr function) const
1956 {
1957 executeMore(
1958 context,
1959 opPos + 2,
1962 function);
1963 }
1964
1965 /**
1966 * Execute an expression as a group.
1967 * @param context The current source tree context node.
1968 * @param opPos The current position in the Op Map.
1969 * @param executionContext current execution context
1970 * @param theResult The result of the execution
1971 */
1972 void
1978 {
1979 const XObjectPtr theValue(executeMore(
1980 context,
1981 opPos + 2,
1983 theResult));
1984
1985 if (theValue.null() == false)
1986 {
1987 theResult.addNodesInDocOrder(
1988 theValue->nodeset(),
1990
1991 theResult.setDocumentOrder();
1992 }
1993 }
1994
1995 /**
1996 * Get a literal value.
1997 * @param opPos The current position in the Op Map.
1998 * @return The result as a double.
1999 */
2000 double
2002
2003 /**
2004 * Get a literal value.
2005 * @param opPos The current position in the Op Map.
2006 * @return The result as a double.
2007 */
2008 const XObjectPtr
2012
2013 /**
2014 * Get a literal value as a boolean.
2015 *
2016 * @param opPos The current position in the Op Map.
2017 * @param theResult The string.
2018 */
2019 void
2022 bool& theResult) const;
2023
2024 /**
2025 * Get a literal value. The value is appended to the
2026 * supplied string.
2027 *
2028 * @param opPos The current position in the Op Map.
2029 * @param theResult The string.
2030 */
2031 void
2034 XalanDOMString& theResult) const;
2035
2036 /**
2037 * Get a literal value.
2038 *
2039 * @param opPos The current position in the Op Map.
2040 * @param formatterListener the FormatterListener instance to receive the result
2041 * @param function A pointer to the member function of FormatterListener to call
2042 */
2043 void
2047 MemberFunctionPtr function) const;
2048
2049 /**
2050 * Setup for and run an extension function.
2051 * @param context The current source tree context node.
2052 * @param opPos The current position in the Op Map.
2053 * @param executionContext current execution context
2054 * @return the result of the function.
2055 */
2056 const XObjectPtr
2061
2062 /**
2063 * Handle an extension function.
2064 * @param context The current source tree context node.
2065 * @param opPos The current position in the Op Map.
2066 * @param theNamespace The namespace of the function.
2067 * @param functionName The name of the function.
2068 * @param executionContext current execution context
2069 * @return the result of the function.
2070 */
2071 const XObjectPtr
2074 OpCodeMapPositionType /* opPos */,
2076 const XalanDOMString& functionName,
2079 {
2080 return executionContext.extFunction(theNamespace,
2081 functionName,
2082 context,
2083 argVec,
2084 m_locator);
2085 }
2086
2087 /**
2088 * Setup for and run a function.
2089 * @param context The current source tree context node.
2090 * @param opPos The current position in the Op Map.
2091 * @param executionContext current execution context
2092 * @return the result of the function.
2093 */
2094 const XObjectPtr
2099
2100 /**
2101 * Handle a built-in function.
2102 * @param context The current source tree context node.
2103 * @param funcID The function ID.
2104 * @param argVec The arguments for the function.
2105 * @param executionContext current execution context
2106 * @return the result of the function.
2107 */
2108 const XObjectPtr
2114 {
2115 return s_functions[funcID].execute(executionContext, context, argVec, m_locator);
2116 }
2117
2118 /**
2119 * Handle the built-in function "position".
2120 *
2121 * @param context The current source tree context node, which must not be 0.
2122 * @param executionContext current execution context
2123 * @return the result of the function.
2124 */
2125 double
2129 {
2130 assert(context != 0);
2131
2133 executionContext.getContextNodeListPosition(*context);
2134 assert(static_cast<double>(theResult) == theResult);
2135
2136 return static_cast<double>(theResult);
2137 }
2138
2139 /**
2140 * Handle the built-in function "last".
2141 *
2142 * @param executionContext current execution context
2143 * @return the result of the function.
2144 */
2145 double
2147 {
2149 executionContext.getContextNodeListLength();
2150 assert(static_cast<double>(theResult) == theResult);
2151
2152 return static_cast<double>(theResult);
2153 }
2154
2155 /**
2156 * Handle the built-in function "count".
2157 *
2158 * @param context The current source tree context node.
2159 * @param opPos The current position in the Op Map.
2160 * @param executionContext current execution context
2161 * @return the result of the function.
2162 */
2163 double
2168
2169 /**
2170 * Handle the built-in function "not".
2171 *
2172 * @param context The current source tree context node, which must not be 0.
2173 * @param opPos The current position in the Op Map.
2174 * @param executionContext current execution context
2175 * @return the result of the function.
2176 */
2177 bool
2182 {
2183 assert(context != 0);
2184
2185 return !functionBoolean(context, opPos, executionContext);
2186 }
2187
2188 /**
2189 * Handle the built-in function "boolean".
2190 *
2191 * @param context The current source tree context node, which must not be 0.
2192 * @param opPos The current position in the Op Map.
2193 * @param executionContext current execution context
2194 * @return the result of the function.
2195 */
2196 bool
2201 {
2202 assert(context != 0);
2203
2204 bool result;
2205
2206 executeMore(context, opPos + 2, executionContext, result);
2207
2208 return result;
2209 }
2210
2211 /**
2212 * Handle the built-in function "name".
2213 *
2214 * @param context The current source tree context node, which must not be 0.
2215 * @return the result of the function.
2216 */
2217 const XalanDOMString&
2219 {
2220 assert(context != 0);
2221
2222 return DOMServices::getNameOfNode(*context);
2223 }
2224
2225 /**
2226 * Handle the built-in function "name".
2227 *
2228 * @param context The current source tree context node, which must not be 0.
2229 * @param opPos The current position in the Op Map.
2230 * @param executionContext current execution context
2231 * @return the result of the function.
2232 */
2233 const XalanDOMString&
2238
2239 /**
2240 * Handle the built-in function "local-name".
2241 *
2242 * @param context The current source tree context node, which must not be 0.
2243 * @return the result of the function.
2244 */
2245 const XalanDOMString&
2247
2248 /**
2249 * Handle the built-in function "local-name".
2250 *
2251 * @param context The current source tree context node, which must not be 0.
2252 * @param opPos The current position in the Op Map.
2253 * @param executionContext current execution context
2254 * @return the result of the function.
2255 */
2256 const XalanDOMString&
2261
2262 /**
2263 * Handle the built-in function "number".
2264 *
2265 * @param context The current source tree context node, which must not be 0.
2266 * @param executionContext current execution context
2267 * @return the result of the function.
2268 */
2269 double
2273 {
2274 assert(context != 0);
2275
2276 return XObject::number(executionContext, *context);
2277 }
2278
2279 /**
2280 * Handle the built-in function "number".
2281 *
2282 * @param context The current source tree context node, which must not be 0.
2283 * @param opPos The current position in the Op Map.
2284 * @param executionContext current execution context
2285 * @return the result of the function.
2286 */
2287 double
2292 {
2293 double result;
2294
2295 executeMore(context, opPos + 2, executionContext, result);
2296
2297 return result;
2298 }
2299
2300 /**
2301 * Handle the built-in function "floor".
2302 *
2303 * @param context The current source tree context node, which must not be 0.
2304 * @param opPos The current position in the Op Map.
2305 * @param executionContext current execution context
2306 * @return the result of the function.
2307 */
2308 double
2313 {
2314 return DoubleSupport::floor(functionNumber(context, opPos, executionContext));
2315 }
2316
2317 /**
2318 * Handle the built-in function "ceiling".
2319 *
2320 * @param context The current source tree context node, which must not be 0.
2321 * @param opPos The current position in the Op Map.
2322 * @param executionContext current execution context
2323 * @return the result of the function.
2324 */
2325 double
2330 {
2331 return DoubleSupport::ceiling(functionNumber(context, opPos, executionContext));
2332 }
2333
2334 /**
2335 * Handle the built-in function "round".
2336 *
2337 * @param context The current source tree context node, which must not be 0.
2338 * @param opPos The current position in the Op Map.
2339 * @param executionContext current execution context
2340 * @return the result of the function.
2341 */
2342 double
2347 {
2348 return DoubleSupport::round(functionNumber(context, opPos, executionContext));
2349 }
2350
2351 /**
2352 * Handle the built-in function "string-length".
2353 *
2354 * @param context The current source tree context node, which must not be 0.
2355 * @param executionContext current execution context
2356 * @return the result of the function.
2357 */
2358 double
2362
2363 /**
2364 * Handle the built-in function "string-length".
2365 *
2366 * @param context The current source tree context node, which must not be 0.
2367 * @param opPos The current position in the Op Map.
2368 * @param executionContext current execution context
2369 * @return the result of the function.
2370 */
2371 double
2376
2377 /**
2378 * Handle the built-in function "sum".
2379 *
2380 * @param context The current source tree context node.
2381 * @param opPos The current position in the Op Map.
2382 * @param executionContext current execution context
2383 * @return the result of the function.
2384 */
2385 double
2390
2391 /**
2392 * Get a numeric operand for an expression.
2393 * @param context The current source tree context node.
2394 * @param opPos The current position in the Op Map.
2395 * @param executionContext current execution context
2396 * @return The value of the operand.
2397 */
2398 double
2403
2404private:
2405
2406 // These are not implemented...
2407 XPath(const XPath&);
2408
2409 XPath&
2410 operator=(const XPath&);
2411
2412 bool
2413 operator==(const XPath&) const;
2414
2415 // Default vector allocation sizes.
2416 enum
2417 {
2418 eDefaultTargetDataSize = 5
2419 };
2420
2421 OpCodeMapPositionType
2422 getInitialOpCodePosition() const
2423 {
2424#if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)
2425 assert(m_expression.getOpCodeMapValue(0) == XPathExpression::eOP_XPATH);
2426#else
2427 assert(m_expression.getOpCodeMapValue(
2428 m_expression.getInitialOpCodePosition()) == XPathExpression::eOP_XPATH);
2429#endif
2430 return m_expression.getInitialOpCodePosition() + 2;
2431 }
2432
2433 eMatchScore
2434 locationPathPattern(
2435 XPathExecutionContext& executionContext,
2436 XalanNode& context,
2437 OpCodeMapPositionType opPos) const;
2438
2439protected:
2440
2441 /**
2442 * Execute a step in a location path.
2443 *
2444 * @param xpath The xpath that is executing
2445 * @param context The current source tree context node
2446 * @param opPos The current position in the xpath operation map array
2447 * @param queryResults The set of nodes that matches the step.
2448 */
2449 void
2455
2456 /**
2457 * Potentially evaluate a predicate in a match pattern step.
2458 *
2459 * @param executionContext The current execution context.
2460 * @param context The current source tree context node.
2461 * @param opPos The current position in the Op Map.
2462 * @param startOpPos The original position for the step in the Op Map.
2463 * @param score The current match score for the context node.
2464 * @return The resulting match score
2465 */
2472 eMatchScore score) const;
2473
2474 /**
2475 * Execute a step in a match pattern's location path.
2476 *
2477 * @param xpath The xpath that is executing
2478 * @param context The current source tree context node
2479 * @param opPos The current position in the xpath operation map array
2480 * @param scoreHolder a reference to an eMatchScore to receive
2481 * the result.
2482 * @return the last matched context node
2483 */
2484 XalanNode*
2489 eMatchScore& scoreHolder) const;
2490
2498
2506
2514
2522
2530
2538
2546
2554
2562
2570
2578
2586
2594
2602
2610
2616
2622
2628
2629private:
2630
2631 void
2632 unknownOpCodeError(
2636
2637 void
2638 notNodeSetError(
2641
2642 // Data members...
2643
2644 /**
2645 *
2646 * Holds information about the current expression.
2647 *
2648 */
2649 XPathExpression m_expression;
2650
2651 /**
2652 * A Locator for reporting errors.
2653 */
2654 const Locator* m_locator;
2655
2656 /**
2657 * If true, the XPath can allocated XObjects in more
2658 * efficient ways, since its lifetime is guaranteed
2659 * to be at least that of the transformation.
2660 */
2661 bool m_inStylesheet;
2662
2663 /**
2664 *
2665 * This is the table of installed functions.
2666 *
2667 */
2668 static FunctionTableType s_functions;
2669
2670 static const XalanDOMString s_emptyString;
2671};
2672
2673
2674
2675}
2676
2677
2678
2679#endif // XPATH_HEADER_GUARD_1357924680
#define XALAN_XPATH_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
A SAX-based formatter interface for the XSL processor.
Local implementation of MutableNodeRefList.
Local implementation of NodeRefList.
This class defines an interface for classes that resolve namespace prefixes to their URIs.
Class to hold XObjectPtr return types.
Definition XObject.hpp:884
Class defines a table of functions that can be called in XPath expresions.
eMatchScore initialize(XPathConstructionContext &theConstructionContext, const XalanDOMString &theNameTest, const PrefixResolver &thePrefixResolver, const Locator *theLocator)
NodeTester(XPathConstructionContext &theContext, const XalanDOMString &theNameTest, const PrefixResolver &thePrefixResolver, const Locator *theLocator=0, eMatchScore *theMatchScore=0)
NodeTester(const NodeTester &theSource)
NodeTester(const XalanDOMString &theNamespaceURI, const XalanDOMString &theLocalName, eMatchScore *theMatchScore=0)
NodeTester & operator=(const NodeTester &theRHS)
Definition XPath.hpp:1076
NodeTester(const XPath &xpath, XPathExecutionContext &executionContext, OpCodeMapPositionType opPos, OpCodeMapValueType argLen, OpCodeMapValueType stepType)
eMatchScore initialize(const XalanDOMString &theNamespaceURI, const XalanDOMString &theLocalName)
eMatchScore operator()(const XalanNode &context, XalanNode::NodeType nodeType) const
Definition XPath.hpp:1060
eMatchScore operator()(const XalanElement &context) const
Definition XPath.hpp:1070
const XalanDOMChar * getString() const
Definition XPath.hpp:122
eMatchScore getDefaultPriority() const
Definition XPath.hpp:128
eTargetType getTargetType() const
Definition XPath.hpp:134
TargetData(const XalanDOMChar *theString, eMatchScore thePriority, eTargetType theTargetType)
Definition XPath.hpp:111
void neg(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Return the negation of a number.
static bool uninstallFunction(const XalanDOMChar *funcName)
Remove a named function from the function table.
Definition XPath.hpp:960
const XObjectPtr locationPath(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Execute a location path.
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute the XPath from the provided context.
Definition XPath.hpp:746
XPathExecutionContext::GetCachedString GetCachedString
Definition XPath.hpp:76
bool gt(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Tell if one argument is greater than the other argument.
void numberlit(OpCodeMapPositionType opPos, bool &theResult) const
Get a literal value as a boolean.
const XalanDOMString & functionName(XalanNode *context) const
Handle the built-in function "name".
Definition XPath.hpp:2218
void executeMore(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, double &theResult) const
Execute the XPath from the provided context.
double mod(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Return the remainder from a truncating division.
double functionCount(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "count".
void execute(XalanNode *context, const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, XalanDOMString &result) const
Execute the XPath from the provided context.
bool lte(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Tell if one argument is less than or equal to the other argument.
MemoryManager & getMemoryManager()
Definition XPath.hpp:178
XPathFunctionTable FunctionTableType
Definition XPath.hpp:977
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, MutableNodeRefList &theResult) const
Execute an expression as a group.
Definition XPath.hpp:1973
const XObjectPtr executeMore(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, MutableNodeRefList &theResult) const
Execute the XPath from the provided context.
bool And(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
OR two expressions and return the boolean result.
const XObjectPtr execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext) const
Execute the XPath from the provided context.
Definition XPath.hpp:309
void execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, bool &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:333
bool lt(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Tell if one argument is less than the other argument.
void numberlit(OpCodeMapPositionType opPos, FormatterListener &formatterListener, MemberFunctionPtr function) const
Get a literal value.
double minus(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Give the difference of two arguments.
double functionFloor(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "floor".
Definition XPath.hpp:2309
static void installFunction(const XalanDOMChar *funcName, const Function &func)
Install a built-in function.
Definition XPath.hpp:933
const XObjectPtr execute(XalanNode *context, const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext) const
Execute the XPath from the provided context.
OpCodeMapPositionType findSelf(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
static double getMatchScoreValue(eMatchScore score)
Definition XPath.hpp:831
static XPath * create(MemoryManager &theManager, const Locator *theLocator=0)
void executeMore(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, XalanDOMString &theResult) const
Execute the XPath from the provided context.
void execute(XalanNode *context, const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, double &result) const
Execute the XPath from the provided context.
double functionStringLength(XalanNode *context, XPathExecutionContext &executionContext) const
Handle the built-in function "string-length".
static void destroyTable()
Definition XPath.hpp:1003
OpCodeMapPositionType findNamespace(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
static void installFunction(const XalanDOMString &funcName, const Function &func)
Install a built-in function.
Definition XPath.hpp:918
void execute(XPathExecutionContext &executionContext, XalanDOMString &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:542
void locationPath(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, XalanDOMString &theResult) const
Execute a location path.
double mult(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Multiply two arguments.
eMatchScore handleFoundIndex(XPathExecutionContext &executionContext, XalanNode *localContext, OpCodeMapPositionType startOpPos) const
const XObjectPtr execute(XPathExecutionContext &executionContext, MutableNodeRefList &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:604
double div(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Divide a number.
bool gte(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Tell if one argument is greater than or equal to the other argument.
void Union(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Computes the union of its operands which must be node-sets.
void execute(XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute the XPath from the provided context.
Definition XPath.hpp:567
void literal(OpCodeMapPositionType opPos, FormatterListener &formatterListener, MemberFunctionPtr function) const
Get a literal value.
XalanNode * stepPattern(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, eMatchScore &scoreHolder) const
Execute a step in a match pattern's location path.
void mod(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Return the remainder from a truncating division.
OpCodeMapPositionType findChildren(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
void step(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, MutableNodeRefList &queryResults) const
Execute a step in a location path.
void div(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Divide a number.
OpCodeMapPositionType findFollowing(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
double numberlit(OpCodeMapPositionType opPos) const
Get a literal value.
XPathExpression::OpCodeMapValueType OpCodeMapValueType
Definition XPath.hpp:74
void Union(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, double &result) const
Computes the union of its operands which must be node-sets.
double functionLast(XPathExecutionContext &executionContext) const
Handle the built-in function "last".
Definition XPath.hpp:2146
bool Or(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
OR two expressions and return the boolean result.
bool getInStylesheet() const
Definition XPath.hpp:1009
eMatchScore getMatchScore(XalanNode *node, const PrefixResolver &resolver, XPathExecutionContext &executionContext) const
Get the match score for the specified node.
void getTargetData(TargetDataVectorType &targetData) const
Add the data for the target of match pattern to a vector.
bool functionBoolean(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "boolean".
Definition XPath.hpp:2197
double functionNumber(XalanNode *context, XPathExecutionContext &executionContext) const
Handle the built-in function "number".
Definition XPath.hpp:2270
XPathExpression & getExpression()
Retrieve a reference to the current expression.
Definition XPath.hpp:814
OpCodeMapPositionType findDescendants(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, XalanDOMString &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:718
const XObjectPtr execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext) const
Execute the XPath from the provided context.
Definition XPath.hpp:629
XPathExpression::OpCodeMapPositionType OpCodeMapPositionType
Definition XPath.hpp:73
double functionNumber(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "number".
Definition XPath.hpp:2288
OpCodeMapPositionType findRoot(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
void shrink()
Shrink internal tables.
Definition XPath.hpp:189
static void terminate()
Perform static shut down.
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, bool &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:657
bool equals(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Tell if two expressions are functionally equal.
const XalanDOMString & functionName(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "name".
void executeMore(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute the XPath from the provided context.
double functionStringLength(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "string-length".
void execute(XalanNode *context, const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute the XPath from the provided context.
const XObjectPtr execute(XPathExecutionContext &executionContext) const
Execute the XPath from the provided context.
Definition XPath.hpp:472
static bool isInstalledFunction(const XalanDOMString &theFunctionName)
Whether the named function is installed in the function table.
Definition XPath.hpp:972
void execute(XPathExecutionContext &executionContext, double &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:517
const XObjectPtr execute(XalanNode *context, const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, MutableNodeRefList &result) const
Execute the XPath from the provided context.
OpCodeMapPositionType findPreceedingSiblings(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
xercesc::Locator LocatorType
Definition XPath.hpp:71
void execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, double &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:358
eMatchScore getMatchScore(XalanNode *node, XPathExecutionContext &executionContext) const
Get the match score for the specified node.
eMatchScore doStepPredicate(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapPositionType startOpPos, eMatchScore score) const
Potentially evaluate a predicate in a match pattern step.
const XObjectPtr predicate(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Evaluate a predicate.
Definition XPath.hpp:895
void execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, double &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:687
double plus(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Give the sum of two arguments.
static bool uninstallFunction(const XalanDOMString &funcName)
Remove a named function from the function table.
Definition XPath.hpp:948
const XObjectPtr Union(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Computes the union of its operands which must be node-sets.
XPathExpression::TokenQueuePositionType TokenQueuePositionType
Definition XPath.hpp:75
void execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute the XPath from the provided context.
Definition XPath.hpp:410
OpCodeMapPositionType findNodeSet(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
const XObjectPtr extfunction(XalanNode *context, OpCodeMapPositionType, const XalanDOMString &theNamespace, const XalanDOMString &functionName, const Function::XObjectArgVectorType &argVec, XPathExecutionContext &executionContext) const
Handle an extension function.
Definition XPath.hpp:2072
OpCodeMapPositionType findPreceeding(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
const XObjectPtr literal(OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Get a literal value.
void locationPath(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute a location path.
void Union(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, MutableNodeRefList &result) const
Computes the union of its operands which must be node-sets.
void literal(OpCodeMapPositionType opPos, bool &theResult) const
Get a literal value as a boolean.
XObjectPtr execute(const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, MutableNodeRefList &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:789
const Locator * getLocator() const
Definition XPath.hpp:1021
static void getInstalledFunctionNames(OutputIteratorType theIterator)
Add the names for the installed functions to a vector strings.
Definition XPath.hpp:997
double getNumericOperand(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Get a numeric operand for an expression.
void mult(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Multiply two arguments.
void Union(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, bool &result) const
Computes the union of its operands which must be node-sets.
XPathExecutionContext::PrefixResolverSetAndRestore PrefixResolverSetAndRestore
Definition XPath.hpp:77
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, XalanDOMString &theResult) const
Execute an expression as a group.
Definition XPath.hpp:1931
void locationPath(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, double &theResult) const
Execute a location path.
const XObjectPtr numberlit(OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Get a literal value.
void numberlit(OpCodeMapPositionType opPos, XalanDOMString &theResult) const
Get a literal value.
OpCodeMapPositionType findParent(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
double functionPosition(XalanNode *context, XPathExecutionContext &executionContext) const
Handle the built-in function "position".
Definition XPath.hpp:2126
void executeMore(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, bool &theResult) const
Execute the XPath from the provided context.
void Union(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, XalanDOMString &result) const
Computes the union of its operands which must be node-sets.
const XalanDOMString & functionLocalName(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "local-name".
OpCodeMapPositionType findFollowingSiblings(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
const XPathExpression & getExpression() const
Retrieve a reference to the current expression.
Definition XPath.hpp:825
void setInStylesheet(bool fValue)
Definition XPath.hpp:1015
bool functionNot(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "not".
Definition XPath.hpp:2178
void locationPath(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, bool &theResult) const
Execute a location path.
OpCodeMapPositionType findNodesOnUnknownAxis(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
void minus(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Give the difference of two arguments.
void literal(OpCodeMapPositionType opPos, double &theResult) const
Get a literal value as a number.
bool notequals(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Tell if two expressions are functionally not equal.
void execute(XPathExecutionContext &executionContext, bool &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:493
OpCodeMapPositionType findAttributes(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
double functionRound(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "round".
Definition XPath.hpp:2343
const XObjectPtr execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, MutableNodeRefList &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:447
void plus(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Give the sum of two arguments.
double neg(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Return the negation of a number.
@ eMatchScoreQName
Definition XPath.hpp:94
@ eMatchScoreNodeTest
Definition XPath.hpp:92
@ eMatchScoreNone
Definition XPath.hpp:91
@ eMatchScoreNSWild
Definition XPath.hpp:93
static const FunctionTableType & getFunctionTable()
Retrieve the table of installed functions.
Definition XPath.hpp:985
void setLocator(const Locator *theLocator)
Definition XPath.hpp:1027
void doGetMatchScore(XalanNode *context, XPathExecutionContext &executionContext, eMatchScore &score) const
Helper function to get match score.
void locationPath(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, MutableNodeRefList &theResult) const
Execute a location path.
Definition XPath.hpp:1324
const XObjectPtr function(XalanNode *context, OpCodeMapValueType funcID, const Function::XObjectArgVectorType &argVec, XPathExecutionContext &executionContext) const
Handle a built-in function.
Definition XPath.hpp:2109
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Execute an expression as a group.
Definition XPath.hpp:1950
OpCodeMapPositionType findAncestorsOrSelf(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
XPathExecutionContext::CurrentNodePushAndPop CurrentNodePushAndPop
Definition XPath.hpp:78
double functionSum(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "sum".
const XObjectPtr executeMore(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Execute the XPath from the provided context.
static void initialize(MemoryManager &theManager)
Perform static initialization.
eMatchScore handleFoundIndexPositional(XPathExecutionContext &executionContext, XalanNode *localContext, OpCodeMapPositionType startOpPos) const
const XObjectPtr variable(OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Get the value of a variable.
const XObjectPtr runExtFunction(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Setup for and run an extension function.
XPath(MemoryManager &theManager, const Locator *theLocator=0)
Construct an XPath.
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, double &theResult) const
Execute an expression as a group.
Definition XPath.hpp:1914
double functionCeiling(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Handle the built-in function "ceiling".
Definition XPath.hpp:2326
void execute(XalanNode *context, const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext, bool &result) const
Execute the XPath from the provided context.
const XObjectPtr runFunction(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Setup for and run a function.
void literal(OpCodeMapPositionType opPos, XalanDOMString &theResult) const
Get a literal value.
const XObjectPtr group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext) const
Execute an expression as a group.
Definition XPath.hpp:1881
void execute(XalanNode *context, const PrefixResolver &prefixResolver, const NodeRefListBase &contextNodeList, XPathExecutionContext &executionContext, XalanDOMString &result) const
Execute the XPath from the provided context.
Definition XPath.hpp:384
const XalanDOMString & functionLocalName(XalanNode *context) const
Handle the built-in function "local-name".
OpCodeMapPositionType predicates(XPathExecutionContext &executionContext, OpCodeMapPositionType opPos, MutableNodeRefList &subQueryResults) const
OpCodeMapPositionType findAncestors(XPathExecutionContext &executionContext, XalanNode *context, OpCodeMapPositionType opPos, OpCodeMapValueType stepType, MutableNodeRefList &subQueryResults) const
XalanVector< TargetData > TargetDataVectorType
Definition XPath.hpp:148
void group(XalanNode *context, OpCodeMapPositionType opPos, XPathExecutionContext &executionContext, bool &theResult) const
Execute an expression as a group.
Definition XPath.hpp:1897
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)