+Thu Aug 10 13:27:48 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
+
+ * libxslt/transform.c: As suggested by Bill, I changed
+ xsltShallowCopyNsNode() to return an xmlNsPtr instead of
+ an int. The fix of bug #350085 is OK; i.e. the removal
+ of the call to xsltFreeRVTs() in
+ xsltApplyStylesheetInternal(). I think I tried to clear
+ the transformation context as much as possible, in case
+ it is reused; Daniel informed me on the list that reusing
+ the context is not intended, so no need anymore to try
+ to free the fragments immediately after the transformation.
+
Wed Aug 9 13:22:13 PDT 2006 William Brack <wbrack@mmm.com.hk>
* libxslt/transform.c: Fixed problem with cleanup of RVT's, should
* @invocNode: responsible node in the stylesheet; used for error reports
* @list: the list of element nodes in the source tree.
* @insert: the parent in the result tree.
- * @literal: is this a literal result element list
+ * @isLRE: is this a literal result element list
+ * @topElemVisited: indicates if a top-most element was already processed
*
* Make a copy of the full list of tree @list
* and insert it as last children of @insert
*
* Returns a new/existing ns-node, or NULL.
*/
-static int
+static xmlNsPtr
xsltShallowCopyNsNode(xsltTransformContextPtr ctxt,
xmlNodePtr invocNode,
xmlNodePtr insert,
xmlNsPtr tmpns;
if ((insert == NULL) || (insert->type != XML_ELEMENT_NODE))
- return(-1);
+ return(NULL);
if (insert->children != NULL) {
xsltTransformError(ctxt, NULL, invocNode,
"Namespace nodes must be added before "
"any child nodes are added to an element.\n");
- return(1);
+ return(NULL);
}
/*
*
} else if ((ns->prefix[0] == 'x') &&
xmlStrEqual(ns->prefix, BAD_CAST "xml"))
{
- return(0);
+ /*
+ * The XML namespace is built in.
+ */
+ return(NULL);
}
if (insert->nsDef != NULL) {
* Same prefix.
*/
if (xmlStrEqual(tmpns->href, ns->href))
- return(0);
+ return(NULL);
goto occupied;
}
}
}
tmpns = xmlSearchNs(insert->doc, insert, ns->prefix);
if ((tmpns != NULL) && xmlStrEqual(tmpns->href, ns->href))
- return(0);
+ return(NULL);
/*
* Declare a new namespace.
* TODO: The problem (wrt efficiency) with this xmlNewNs() is
* that it will again search the already declared namespaces
* for a duplicate :-/
*/
- xmlNewNs(insert, ns->href, ns->prefix);
- return(0);
+ return(xmlNewNs(insert, ns->href, ns->prefix));
occupied:
/*
* TODO: We could as well raise an error here (like Saxon does),
* or at least generate a warning.
*/
- return(0);
+ return(NULL);
}
/**