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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 strval = xmlXPathPopString (ctxt); | 54 strval = xmlXPathPopString (ctxt); |
55 | 55 |
56 txt = xmlNewDocText (fragment, strval); | 56 txt = xmlNewDocText (fragment, strval); |
57 xmlAddChild((xmlNodePtr) fragment, txt); | 57 xmlAddChild((xmlNodePtr) fragment, txt); |
58 obj = xmlXPathNewNodeSet(txt); | 58 obj = xmlXPathNewNodeSet(txt); |
59 if (obj == NULL) { | 59 if (obj == NULL) { |
60 xsltTransformError(tctxt, NULL, tctxt->inst, | 60 xsltTransformError(tctxt, NULL, tctxt->inst, |
61 "exsltNodeSetFunction: Failed to create a node set object.\n"); | 61 "exsltNodeSetFunction: Failed to create a node set object.\n"); |
62 tctxt->state = XSLT_STATE_STOPPED; | 62 tctxt->state = XSLT_STATE_STOPPED; |
63 } else { | |
64 /* | |
65 * Mark it as a function result in order to avoid garbage | |
66 * collecting of tree fragments | |
67 */ | |
68 xsltExtensionInstructionResultRegister(tctxt, obj); | |
69 } | 63 } |
70 if (strval != NULL) | 64 if (strval != NULL) |
71 xmlFree (strval); | 65 xmlFree (strval); |
72 | 66 |
73 valuePush (ctxt, obj); | 67 valuePush (ctxt, obj); |
74 } | 68 } |
75 } | 69 } |
76 | 70 |
77 static void | 71 static void |
78 exsltObjectTypeFunction (xmlXPathParserContextPtr ctxt, int nargs) { | 72 exsltObjectTypeFunction (xmlXPathParserContextPtr ctxt, int nargs) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 EXSLT_COMMON_NAMESPACE, | 122 EXSLT_COMMON_NAMESPACE, |
129 exsltNodeSetFunction); | 123 exsltNodeSetFunction); |
130 xsltRegisterExtModuleFunction((const xmlChar *) "object-type", | 124 xsltRegisterExtModuleFunction((const xmlChar *) "object-type", |
131 EXSLT_COMMON_NAMESPACE, | 125 EXSLT_COMMON_NAMESPACE, |
132 exsltObjectTypeFunction); | 126 exsltObjectTypeFunction); |
133 xsltRegisterExtModuleElement((const xmlChar *) "document", | 127 xsltRegisterExtModuleElement((const xmlChar *) "document", |
134 EXSLT_COMMON_NAMESPACE, | 128 EXSLT_COMMON_NAMESPACE, |
135 (xsltPreComputeFunction) xsltDocumentComp, | 129 (xsltPreComputeFunction) xsltDocumentComp, |
136 (xsltTransformFunction) xsltDocumentElem); | 130 (xsltTransformFunction) xsltDocumentElem); |
137 } | 131 } |
OLD | NEW |