1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-08-07 10:42:55 +03:00

cleaning up Result Value Tree handling fixed a pair of implementations.

* libxslt/transform.c libxslt/variables.c libxslt/xsltInternals.h:
  cleaning up Result Value Tree handling
* libexslt/functions.c libexslt/strings.c: fixed a pair of
  implementations.
* tests/exslt/strings/Makefile.am tests/exslt/strings/tokenize.2.*:
  added Mark Vakoc test combining for-each and exslt:tokenize
Daniel
This commit is contained in:
Daniel Veillard
2003-04-30 20:47:47 +00:00
parent 95cc2c1cef
commit 4f5120741e
10 changed files with 200 additions and 44 deletions

View File

@@ -511,21 +511,30 @@ exsltFuncResultElem (xsltTransformContextPtr ctxt,
* one or more child nodes), then the content of the
* func:result element specifies the value.
*/
xmlNodePtr container, oldInsert;
xmlNodePtr oldInsert;
xmlDocPtr container;
container = xmlNewDocNode (ctxt->output, NULL,
(const xmlChar *) "fake", NULL);
container = xsltCreateRVT(ctxt);
if (container == NULL) {
xsltGenericError(xsltGenericErrorContext,
"exsltFuncResultElem: out of memory\n");
data->error = 1;
return;
}
xsltRegisterTmpRVT(ctxt, container);
oldInsert = ctxt->insert;
ctxt->insert = container;
ctxt->insert = (xmlNodePtr) container;
xsltApplyOneTemplate (ctxt, ctxt->xpathCtxt->node,
inst->children, NULL, NULL);
ctxt->insert = oldInsert;
ret = xmlXPathNewValueTree(container);
ret = xmlXPathNewValueTree((xmlNodePtr) container);
if (ret == NULL) {
xsltGenericError(xsltGenericErrorContext,
"exsltFuncResultElem: ret == NULL\n");
data->error = 1;
} else {
ret->boolval = 0; /* Freeing is not handled there anymore */
}
} else {
/* If the func:result element has empty content and does not