Chromium Code Reviews| 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 11734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11745 contextObj = xmlXPathCacheNewNodeSet(xpctxt, contextNode); | 11745 contextObj = xmlXPathCacheNewNodeSet(xpctxt, contextNode); |
| 11746 else | 11746 else |
| 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 */ | 11755 » » /* pop the result if any */ |
| 11756 tmp = valuePop(ctxt); | 11756 tmp = valuePop(ctxt); |
| 11757 » » xmlXPathReleaseObject(xpctxt, tmp); | 11757 if (tmp != contextObj) |
| 11758 » » /* then pop off contextObj, which will be freed later */ | 11758 /* |
| 11759 » » valuePop(ctxt); | 11759 * Free up the result |
| 11760 * then pop off contextObj, which will be freed later | |
| 11761 */ | |
| 11762 xmlXPathReleaseObject(xpctxt, tmp); | |
| 11763 valuePop(ctxt); | |
|
Cris Neckar
2010/11/18 00:53:04
ugly indent
| |
| 11760 goto evaluation_error; | 11764 goto evaluation_error; |
| 11761 } | 11765 } |
| 11762 | 11766 |
| 11763 if (res) | 11767 if (res) |
| 11764 pos++; | 11768 pos++; |
| 11765 | 11769 |
| 11766 if (res && (pos >= minPos) && (pos <= maxPos)) { | 11770 if (res && (pos >= minPos) && (pos <= maxPos)) { |
| 11767 /* | 11771 /* |
| 11768 * Fits in the requested range. | 11772 * Fits in the requested range. |
| 11769 */ | 11773 */ |
| (...skipping 3371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 15141 xmlXPathTranslateFunction); | 15145 xmlXPathTranslateFunction); |
| 15142 | 15146 |
| 15143 xmlXPathRegisterFuncNS(ctxt, (const xmlChar *)"escape-uri", | 15147 xmlXPathRegisterFuncNS(ctxt, (const xmlChar *)"escape-uri", |
| 15144 (const xmlChar *)"http://www.w3.org/2002/08/xquery-functions", | 15148 (const xmlChar *)"http://www.w3.org/2002/08/xquery-functions", |
| 15145 xmlXPathEscapeUriFunction); | 15149 xmlXPathEscapeUriFunction); |
| 15146 } | 15150 } |
| 15147 | 15151 |
| 15148 #endif /* LIBXML_XPATH_ENABLED */ | 15152 #endif /* LIBXML_XPATH_ENABLED */ |
| 15149 #define bottom_xpath | 15153 #define bottom_xpath |
| 15150 #include "elfgcchack.h" | 15154 #include "elfgcchack.h" |
| OLD | NEW |