diff options
Diffstat (limited to 'chromium/third_party/libxslt/src/libexslt/dynamic.c')
-rw-r--r-- | chromium/third_party/libxslt/src/libexslt/dynamic.c | 55 |
1 files changed, 24 insertions, 31 deletions
diff --git a/chromium/third_party/libxslt/src/libexslt/dynamic.c b/chromium/third_party/libxslt/src/libexslt/dynamic.c index 9e116283584..91ceb4094a6 100644 --- a/chromium/third_party/libxslt/src/libexslt/dynamic.c +++ b/chromium/third_party/libxslt/src/libexslt/dynamic.c @@ -23,17 +23,10 @@ #define IN_LIBEXSLT #include "libexslt/libexslt.h" -#if defined(_WIN32) && !defined (__CYGWIN__) && (!__MINGW32__) -#include <win32config.h> -#else -#include "config.h" -#endif - #include <libxml/tree.h> #include <libxml/xpath.h> #include <libxml/xpathInternals.h> -#include <libxslt/xsltconfig.h> #include <libxslt/xsltutils.h> #include <libxslt/xsltInternals.h> #include <libxslt/extensions.h> @@ -195,19 +188,19 @@ exsltDynMapFunction(xmlXPathParserContextPtr ctxt, int nargs) break; case XPATH_BOOLEAN: if (container != NULL) { - xmlNodePtr cur = - xmlNewChild((xmlNodePtr) container, NULL, - BAD_CAST "boolean", - BAD_CAST (subResult-> - boolval ? "true" : "")); - if (cur != NULL) { - cur->ns = - xmlNewNs(cur, + xmlNodePtr newChildNode = + xmlNewTextChild((xmlNodePtr) container, NULL, + BAD_CAST "boolean", + BAD_CAST (subResult-> + boolval ? "true" : "")); + if (newChildNode != NULL) { + newChildNode->ns = + xmlNewNs(newChildNode, BAD_CAST "http://exslt.org/common", BAD_CAST "exsl"); xmlXPathNodeSetAddUnique(ret->nodesetval, - cur); + newChildNode); } } break; @@ -216,37 +209,37 @@ exsltDynMapFunction(xmlXPathParserContextPtr ctxt, int nargs) xmlChar *val = xmlXPathCastNumberToString(subResult-> floatval); - xmlNodePtr cur = - xmlNewChild((xmlNodePtr) container, NULL, - BAD_CAST "number", val); + xmlNodePtr newChildNode = + xmlNewTextChild((xmlNodePtr) container, NULL, + BAD_CAST "number", val); if (val != NULL) xmlFree(val); - if (cur != NULL) { - cur->ns = - xmlNewNs(cur, + if (newChildNode != NULL) { + newChildNode->ns = + xmlNewNs(newChildNode, BAD_CAST "http://exslt.org/common", BAD_CAST "exsl"); xmlXPathNodeSetAddUnique(ret->nodesetval, - cur); + newChildNode); } } break; case XPATH_STRING: if (container != NULL) { - xmlNodePtr cur = - xmlNewChild((xmlNodePtr) container, NULL, - BAD_CAST "string", - subResult->stringval); - if (cur != NULL) { - cur->ns = - xmlNewNs(cur, + xmlNodePtr newChildNode = + xmlNewTextChild((xmlNodePtr) container, NULL, + BAD_CAST "string", + subResult->stringval); + if (newChildNode != NULL) { + newChildNode->ns = + xmlNewNs(newChildNode, BAD_CAST "http://exslt.org/common", BAD_CAST "exsl"); xmlXPathNodeSetAddUnique(ret->nodesetval, - cur); + newChildNode); } } break; |