OLD | NEW |
1 /* | 1 /* |
2 * xpath.c: XML Path Language implementation | 2 * xpath.c: XML Path Language implementation |
3 * XPath is a language for addressing parts of an XML document, | 3 * XPath is a language for addressing parts of an XML document, |
4 * designed to be used by both XSLT and XPointer | 4 * designed to be used by both XSLT and XPointer |
5 *f | 5 *f |
6 * Reference: W3C Recommendation 16 November 1999 | 6 * Reference: W3C Recommendation 16 November 1999 |
7 * http://www.w3.org/TR/1999/REC-xpath-19991116 | 7 * http://www.w3.org/TR/1999/REC-xpath-19991116 |
8 * Public reference: | 8 * Public reference: |
9 * http://www.w3.org/TR/xpath | 9 * http://www.w3.org/TR/xpath |
10 * | 10 * |
(...skipping 11736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11747 xmlXPathNodeSetAddUnique(contextObj->nodesetval, | 11747 xmlXPathNodeSetAddUnique(contextObj->nodesetval, |
11748 contextNode); | 11748 contextNode); |
11749 | 11749 |
11750 valuePush(ctxt, contextObj); | 11750 valuePush(ctxt, contextObj); |
11751 res = xmlXPathCompOpEvalToBoolean(ctxt, exprOp, 1); | 11751 res = xmlXPathCompOpEvalToBoolean(ctxt, exprOp, 1); |
11752 | 11752 |
11753 if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) { | 11753 if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) { |
11754 xmlXPathObjectPtr tmp; | 11754 xmlXPathObjectPtr tmp; |
11755 /* pop the result if any */ | 11755 /* pop the result if any */ |
11756 tmp = valuePop(ctxt); | 11756 tmp = valuePop(ctxt); |
11757 if (tmp != contextObj) | 11757 while (tmp != contextObj) { |
11758 /* | 11758 /* |
11759 * Free up the result | 11759 * Free up the result |
11760 * then pop off contextObj, which will be freed later | 11760 * then pop off contextObj, which will be freed later |
11761 */ | 11761 */ |
11762 xmlXPathReleaseObject(xpctxt, tmp); | 11762 xmlXPathReleaseObject(xpctxt, tmp); |
11763 valuePop(ctxt); | 11763 tmp = valuePop(ctxt); |
| 11764 } |
11764 goto evaluation_error; | 11765 goto evaluation_error; |
11765 } | 11766 } |
11766 | 11767 |
11767 if (res) | 11768 if (res) |
11768 pos++; | 11769 pos++; |
11769 | 11770 |
11770 if (res && (pos >= minPos) && (pos <= maxPos)) { | 11771 if (res && (pos >= minPos) && (pos <= maxPos)) { |
11771 /* | 11772 /* |
11772 * Fits in the requested range. | 11773 * Fits in the requested range. |
11773 */ | 11774 */ |
(...skipping 3371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15145 xmlXPathTranslateFunction); | 15146 xmlXPathTranslateFunction); |
15146 | 15147 |
15147 xmlXPathRegisterFuncNS(ctxt, (const xmlChar *)"escape-uri", | 15148 xmlXPathRegisterFuncNS(ctxt, (const xmlChar *)"escape-uri", |
15148 (const xmlChar *)"http://www.w3.org/2002/08/xquery-functions", | 15149 (const xmlChar *)"http://www.w3.org/2002/08/xquery-functions", |
15149 xmlXPathEscapeUriFunction); | 15150 xmlXPathEscapeUriFunction); |
15150 } | 15151 } |
15151 | 15152 |
15152 #endif /* LIBXML_XPATH_ENABLED */ | 15153 #endif /* LIBXML_XPATH_ENABLED */ |
15153 #define bottom_xpath | 15154 #define bottom_xpath |
15154 #include "elfgcchack.h" | 15155 #include "elfgcchack.h" |
OLD | NEW |