OLD | NEW |
1 #define IN_LIBEXSLT | 1 #define IN_LIBEXSLT |
2 #include "libexslt/libexslt.h" | 2 #include "libexslt/libexslt.h" |
3 | 3 |
4 #if defined(WIN32) && !defined (__CYGWIN__) && (!__MINGW32__) | 4 #if defined(WIN32) && !defined (__CYGWIN__) && (!__MINGW32__) |
5 #include <win32config.h> | 5 #include <win32config.h> |
6 #else | 6 #else |
7 #include "config.h" | 7 #include "config.h" |
8 #endif | 8 #endif |
9 | 9 |
10 #include <libxml/tree.h> | 10 #include <libxml/tree.h> |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 break; | 104 break; |
105 } | 105 } |
106 } | 106 } |
107 } | 107 } |
108 if (token != cur) { | 108 if (token != cur) { |
109 node = xmlNewDocRawNode(container, NULL, | 109 node = xmlNewDocRawNode(container, NULL, |
110 (const xmlChar *) "token", token); | 110 (const xmlChar *) "token", token); |
111 xmlAddChild((xmlNodePtr) container, node); | 111 xmlAddChild((xmlNodePtr) container, node); |
112 xmlXPathNodeSetAddUnique(ret->nodesetval, node); | 112 xmlXPathNodeSetAddUnique(ret->nodesetval, node); |
113 } | 113 } |
114 /* | |
115 * Mark it as a function result in order to avoid garbage | |
116 * collecting of tree fragments | |
117 */ | |
118 xsltExtensionInstructionResultRegister(tctxt, ret); | |
119 } | 114 } |
120 } | 115 } |
121 | 116 |
122 fail: | 117 fail: |
123 if (str != NULL) | 118 if (str != NULL) |
124 xmlFree(str); | 119 xmlFree(str); |
125 if (delimiters != NULL) | 120 if (delimiters != NULL) |
126 xmlFree(delimiters); | 121 xmlFree(delimiters); |
127 if (ret != NULL) | 122 if (ret != NULL) |
128 valuePush(ctxt, ret); | 123 valuePush(ctxt, ret); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 cur = cur + delimiterLength - 1; | 210 cur = cur + delimiterLength - 1; |
216 token = cur + 1; | 211 token = cur + 1; |
217 } | 212 } |
218 } | 213 } |
219 if (token != cur) { | 214 if (token != cur) { |
220 node = xmlNewDocRawNode(container, NULL, | 215 node = xmlNewDocRawNode(container, NULL, |
221 (const xmlChar *) "token", token); | 216 (const xmlChar *) "token", token); |
222 xmlAddChild((xmlNodePtr) container, node); | 217 xmlAddChild((xmlNodePtr) container, node); |
223 xmlXPathNodeSetAddUnique(ret->nodesetval, node); | 218 xmlXPathNodeSetAddUnique(ret->nodesetval, node); |
224 } | 219 } |
225 /* | |
226 * Mark it as a function result in order to avoid garbage | |
227 * collecting of tree fragments | |
228 */ | |
229 xsltExtensionInstructionResultRegister(tctxt, ret); | |
230 } | 220 } |
231 } | 221 } |
232 | 222 |
233 fail: | 223 fail: |
234 if (str != NULL) | 224 if (str != NULL) |
235 xmlFree(str); | 225 xmlFree(str); |
236 if (delimiter != NULL) | 226 if (delimiter != NULL) |
237 xmlFree(delimiter); | 227 xmlFree(delimiter); |
238 if (ret != NULL) | 228 if (ret != NULL) |
239 valuePush(ctxt, ret); | 229 valuePush(ctxt, ret); |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 return(-1); | 526 return(-1); |
537 } | 527 } |
538 xmlAddChild((xmlNodePtr) container, text_node); | 528 xmlAddChild((xmlNodePtr) container, text_node); |
539 | 529 |
540 ret = xmlXPathNewNodeSet(text_node); | 530 ret = xmlXPathNewNodeSet(text_node); |
541 if (ret == NULL) { | 531 if (ret == NULL) { |
542 xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR); | 532 xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR); |
543 return(-1); | 533 return(-1); |
544 } | 534 } |
545 | 535 |
546 xsltExtensionInstructionResultRegister(tctxt, ret); | |
547 valuePush(ctxt, ret); | 536 valuePush(ctxt, ret); |
548 | 537 |
549 return(0); | 538 return(0); |
550 } | 539 } |
551 | 540 |
552 /** | 541 /** |
553 * exsltStrReplaceFunction: | 542 * exsltStrReplaceFunction: |
554 * @ctxt: an XPath parser context | 543 * @ctxt: an XPath parser context |
555 * @nargs: the number of arguments | 544 * @nargs: the number of arguments |
556 * | 545 * |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 (const xmlChar *) EXSLT_STRINGS_NAMESPACE, | 827 (const xmlChar *) EXSLT_STRINGS_NAMESPACE, |
839 exsltStrAlignFunction) | 828 exsltStrAlignFunction) |
840 && !xmlXPathRegisterFuncNS(ctxt, | 829 && !xmlXPathRegisterFuncNS(ctxt, |
841 (const xmlChar *) "concat", | 830 (const xmlChar *) "concat", |
842 (const xmlChar *) EXSLT_STRINGS_NAMESPACE, | 831 (const xmlChar *) EXSLT_STRINGS_NAMESPACE, |
843 exsltStrConcatFunction)) { | 832 exsltStrConcatFunction)) { |
844 return 0; | 833 return 0; |
845 } | 834 } |
846 return -1; | 835 return -1; |
847 } | 836 } |
OLD | NEW |