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

Fixed problem with cleanup of RVT's, should clear bug350085; cleaned up

* libxslt/transform.c: Fixed problem with cleanup of RVT's, should
  clear bug350085; cleaned up most warnings (still a problem in
  xsltShallowCopyNsNode)
* trivial warning cleanup in libxslt/[extensions.c, namespaces.c,
  xslt.c and xsltInternals.h] and libexslt/functions.c
This commit is contained in:
William M. Brack
2006-08-09 18:22:39 +00:00
parent 1564b7c617
commit 4b155f2bb2
7 changed files with 43 additions and 19 deletions

View File

@@ -1,3 +1,11 @@
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
clear bug350085; cleaned up most warnings (still a problem in
xsltShallowCopyNsNode)
* trivial warning cleanup in libxslt/[extensions.c, namespaces.c,
xslt.c and xsltInternals.h] and libexslt/functions.c
Fri Aug 4 14:50:41 CEST 2006 Daniel Veillard <daniel@veillard.com>
* python/generator.py: fixed the conversion of long parameters

View File

@@ -57,7 +57,7 @@ static void exsltFuncFunctionFunction (xmlXPathParserContextPtr ctxt,
int nargs);
static exsltFuncFunctionData *exsltFuncNewFunctionData(void);
static const xmlChar *exsltResultDataID = (const xmlChar *) "EXSLT Result";
/*static const xmlChar *exsltResultDataID = (const xmlChar *) "EXSLT Result";*/
/**
* exsltFuncRegisterFunc:

View File

@@ -324,7 +324,7 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI)
const xmlChar *ext_directory = NULL;
const xmlChar *protocol = NULL;
xmlChar *i, *regfunc_name;
int rc, seen_before;
int rc;
/* check for bad inputs */
if (URI == NULL)
@@ -337,8 +337,7 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI)
}
/* have we attempted to register this module already? */
seen_before = (int) xmlHashLookup(xsltModuleHash, URI);
if (0 != seen_before) {
if (xmlHashLookup(xsltModuleHash, URI) != NULL) {
return (-1);
}
@@ -778,8 +777,9 @@ xsltStyleGetExtData(xsltStylesheetPtr style, const xmlChar * URI)
return(NULL);
}
#ifdef XSLT_REFACTORED
/**
* xsltStyleGetExtDataPerStylesheetLevel:
* xsltStyleStylesheetLevelGetExtData:
* @style: an XSLT stylesheet
* @URI: the URI associated to the exension module
*
@@ -815,6 +815,7 @@ xsltStyleStylesheetLevelGetExtData(xsltStylesheetPtr style,
return (dataContainer->extData);
return(NULL);
}
#endif
/**
* xsltGetExtData:

View File

@@ -813,8 +813,8 @@ xsltCopyNamespaceList(xsltTransformContextPtr ctxt, xmlNodePtr node,
* Returns: a new xmlNsPtr, or NULL in case of an error.
*/
xmlNsPtr
xsltCopyNamespace(xsltTransformContextPtr ctxt, xmlNodePtr elem,
xmlNsPtr ns)
xsltCopyNamespace(xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
xmlNodePtr elem, xmlNsPtr ns)
{
if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
return(NULL);

View File

@@ -1316,6 +1316,10 @@ xsltShallowCopyNsNode(xsltTransformContextPtr ctxt,
xmlNodePtr insert,
xmlNsPtr ns)
{
/*
* TODO: Contrary to header comments, this is declared as int.
* be modified to return a node pointer, or NULL if any error
*/
xmlNsPtr tmpns;
if ((insert == NULL) || (insert->type != XML_ELEMENT_NODE))
@@ -3016,13 +3020,13 @@ xsltApplyXSLTTemplate(xsltTransformContextPtr ctxt,
* was not called by the extension author.
*/
if (oldLocalFragmentTop != ctxt->localRVT) {
xmlDocPtr cur = ctxt->localRVT, tmp;
xmlDocPtr curdoc = ctxt->localRVT, tmp;
do {
tmp = cur;
cur = (xmlDocPtr) cur->next;
tmp = curdoc;
curdoc = (xmlDocPtr) curdoc->next;
xsltReleaseRVT(ctxt, tmp);
} while (cur != oldLocalFragmentTop);
} while (curdoc != oldLocalFragmentTop);
}
ctxt->localRVT = oldLocalFragmentTop;
@@ -3033,11 +3037,11 @@ xsltApplyXSLTTemplate(xsltTransformContextPtr ctxt,
* of the obsolete xsltRegisterTmpRVT().
*/
if (ctxt->tmpRVT) {
xmlDocPtr cur = ctxt->tmpRVT, tmp;
xmlDocPtr curdoc = ctxt->tmpRVT, tmp;
while (cur != NULL) {
tmp = cur;
cur = (xmlDocPtr) cur->next;
while (curdoc != NULL) {
tmp = curdoc;
curdoc = (xmlDocPtr) curdoc->next;
xsltReleaseRVT(ctxt, tmp);
}
}
@@ -6013,10 +6017,19 @@ xsltApplyStylesheetInternal(xsltStylesheetPtr style, xmlDocPtr doc,
}
vptr = vptr->next;
}
#if 0
/*
* code disabled by wmb; awaiting kb's review
* problem is that global variable(s) may contain xpath objects
* from doc associated with RVT, so can't be freed at this point.
* xsltFreeTransformContext includes a call to xsltFreeRVTs, so
* I assume this shouldn't be required at this point.
*/
/*
* Free all remaining tree fragments.
*/
xsltFreeRVTs(ctxt);
#endif
/*
* Do some post processing work depending on the generated output
*/

View File

@@ -843,12 +843,13 @@ xsltFreeStylesheetList(xsltStylesheetPtr style) {
* @node: the element where the stylesheet is rooted at
*
* Actually @node need not be the document-element, but
* currently Libxslt does not support embedeed stylesheets.
* currently Libxslt does not support embedded stylesheets.
*
* Returns 0 if OK, -1 on API or internal errors.
*/
static int
xsltCleanupStylesheetTree(xmlDocPtr doc, xmlNodePtr rootElem)
xsltCleanupStylesheetTree(xmlDocPtr doc ATTRIBUTE_UNUSED,
xmlNodePtr rootElem ATTRIBUTE_UNUSED)
{
#if 0 /* TODO: Currently disabled, since probably not needed. */
xmlNodePtr cur;

View File

@@ -389,15 +389,16 @@ typedef enum {
XSLT_FUNC_PARAM,
XSLT_FUNC_VARIABLE,
XSLT_FUNC_WHEN,
XSLT_FUNC_EXTENSION,
XSLT_FUNC_EXTENSION
#ifdef XSLT_REFACTORED
,
XSLT_FUNC_OTHERWISE,
XSLT_FUNC_FALLBACK,
XSLT_FUNC_MESSAGE,
XSLT_FUNC_INCLUDE,
XSLT_FUNC_ATTRSET,
XSLT_FUNC_LITERAL_RESULT_ELEMENT,
XSLT_FUNC_UNKOWN_FORWARDS_COMPAT,
XSLT_FUNC_UNKOWN_FORWARDS_COMPAT
#endif
} xsltStyleType;