// FIXME: This code is taken from libexslt 1.1.11; should sync with newer // versions. static void exsltNodeSetFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlChar* strval; xmlNodePtr retNode; xmlXPathObjectPtr ret; if (nargs != 1) { xmlXPathSetArityError(ctxt); return; } if (xmlXPathStackIsNodeSet(ctxt)) { xsltFunctionNodeSet(ctxt, nargs); return; } strval = xmlXPathPopString(ctxt); retNode = xmlNewDocText(0, strval); ret = xmlXPathNewValueTree(retNode); // FIXME: It might be helpful to push any errors from xmlXPathNewValueTree // up to the Javascript Console. if (ret) ret->type = XPATH_NODESET; if (strval) xmlFree(strval); valuePush(ctxt, ret); }
// FIXME: This code is taken from libexslt 1.1.11; should sync with newer versions. static void exsltNodeSetFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlChar *strval; xmlNodePtr retNode; xmlXPathObjectPtr ret; if (nargs != 1) { xmlXPathSetArityError(ctxt); return; } if (xmlXPathStackIsNodeSet(ctxt)) { xsltFunctionNodeSet(ctxt, nargs); return; } strval = xmlXPathPopString(ctxt); retNode = xmlNewDocText(NULL, strval); ret = xmlXPathNewValueTree(retNode); if (ret == NULL) { xsltGenericError(xsltGenericErrorContext, "exsltNodeSetFunction: ret == NULL\n"); } else { ret->type = XPATH_NODESET; } if (strval != NULL) xmlFree(strval); valuePush(ctxt, ret); }