[LIBXSLT] Update to version 1.1.33. CORE-15280

This commit is contained in:
Thomas Faber 2019-01-05 18:34:29 +01:00
parent 5bb277a54b
commit af4421c39a
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
24 changed files with 288 additions and 233 deletions

View file

@ -2057,7 +2057,7 @@ Wed Feb 25 16:35:01 CET 2004 Daniel Veillard <daniel@veillard.com>
* libxslt/attributes.c libxslt/keys.h libxslt/preproc.c
libxslt/transform.c libxslt/variables.c libxslt/xsltutils.c:
First step toward _private cleanup: use the psvi field to store
the precompilation informations in the stylesheet nodes.
the precompilation information in the stylesheet nodes.
Wed Feb 25 14:24:34 CET 2004 Daniel Veillard <daniel@veillard.com>
@ -2402,7 +2402,7 @@ Mon Dec 8 23:34:32 HKT 2003 William Brack <wbrack@mmm.com.hk>
Mon Dec 1 16:41:27 CET 2003 Daniel Veillard <daniel@veillard.com>
* libxslt/*.h *.h.in: updated the metadata informations in the headers
* libxslt/*.h *.h.in: updated the metadata information in the headers
* doc/* doc/html/*: regenerated the docs.
Sun Nov 30 23:25:22 HKT 2003 William Brack <wbrack@mmm.com.hk>
@ -3614,14 +3614,14 @@ Tue Nov 26 16:02:38 CET 2002 Daniel Veillard <daniel@veillard.com>
Tue Nov 26 15:17:13 CET 2002 Daniel Veillard <daniel@veillard.com>
* libxslt/xsltutils.c libxslt/xsltutils.h: added the function
xsltGetProfileInformation() to retrieve profiling informations
xsltGetProfileInformation() to retrieve profiling information
from an XSLT transformation context. It returns it as an XML
tree. Provided by Michael Rothwell this closes RFE #99527
Tue Nov 26 14:40:45 CET 2002 Daniel Veillard <daniel@veillard.com>
* libxslt/imports.c: apply patch from Daniel Stodden, a bug
in xsltFindElemSpaceHandling() missing imported informations
in xsltFindElemSpaceHandling() missing imported information
* tests/REC/stand-2.7-1.stand.out: this change slightly the result
of this test.
@ -3903,7 +3903,7 @@ Mon Oct 14 09:27:01 CEST 2002 Daniel Veillard <daniel@veillard.com>
Tue Oct 15 12:42:25 CEST 2002 Daniel Veillard <daniel@veillard.com>
* README: updated the contact informations
* README: updated the contact information
Tue Oct 15 11:40:19 CEST 2002 Daniel Veillard <daniel@veillard.com>
@ -4196,7 +4196,7 @@ Tue Jul 2 00:02:53 CEST 2002 Daniel Veillard <daniel@veillard.com>
tests/general/Makefile.am tests/general/bug-87.*: added a
example in the regression tests for a case where the XML
default namespace was missing from the namespace axis
* xsltproc/xsltproc.c: added the informations that parameter
* xsltproc/xsltproc.c: added the information that parameter
strings are expected to be UTF8
* libxslt/attributes.c: fixes on attribute group implementation
@ -4685,7 +4685,7 @@ Sun Feb 10 20:16:15 CET 2002 Daniel Veillard <daniel@veillard.com>
* libxslt/imports.c libxslt/numbers.c libxslt/pattern.c
libxslt/pattern.h libxslt/transform.c libxslt/xslt.c
libxslt/xsltInternals.h: adding extra run-time informations
libxslt/xsltInternals.h: adding extra run-time information
to make the stylesheet really read-only at run-time.
Sun Feb 10 16:21:09 CET 2002 Daniel Veillard <daniel@veillard.com>
@ -5822,7 +5822,7 @@ Mon Jul 16 14:26:48 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* tests/*/Makefile.am: updated the path to xsltproc
* libexslt/common.c libexslt/exslt.h libexslt/exsltconfig.h.in
libexslt/functions.c libexslt/math.c libexslt/sets.c: added
versionning informations, some cleanup, and added documentation
versioning information, some cleanup, and added documentation
to a couple of exported functions
Sun Jul 15 15:27:47 CEST 2001 Thomas Broyer <tbroyer@ltgt.net>
@ -5955,7 +5955,7 @@ Sun Jul 8 15:40:44 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Sun Jul 8 14:39:27 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* doc/extensions.html: fixed a number of typo found by Dan York
* libxslt/xsltutils.c: improved the profiling ouput, added the
* libxslt/xsltutils.c: improved the profiling output, added the
average value too.
Sun Jul 8 00:01:21 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@ -6076,7 +6076,7 @@ Thu Jun 28 23:01:14 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Thu Jun 28 15:48:06 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* libxslt/xsltwin32config.h[.in]: added configuration/version
informations for Windows/MSC
information for Windows/MSC
* libxslt/libxslt.h libxslt/*.c: internal header to centralize
includes switches
* libxslt/Makefile.am: added libxslt.h and xsltwin32config.h[.in]
@ -6205,7 +6205,7 @@ Sun Jun 17 13:15:48 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* configure.in: preparing 0.12.0 release
* libxslt/transform.c: a bit of cleanup on the XInclude defaults
* libxslt/xsltconfig.h.in: added doc inline comment
* libxslt/xslt.[ch] libxslt/xsltproc.c: added more version informations
* libxslt/xslt.[ch] libxslt/xsltproc.c: added more version information
and enriched xsltproc --version to show them
* doc/html/*.html: rebuilt the docs
* doc/Makefile.am libxslt.spec.in: try to make sure John Fleck
@ -6440,7 +6440,7 @@ Fri May 18 16:48:13 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* libxslt/xslt.c libxslt/variables.c libxslt/templates.c
libxslt/keys.[ch] libxslt/functions.c: cleanups for ctxt->inst
avoiding modifying stylesheet informations, and fixing
avoiding modifying stylesheet information, and fixing
document() when called from a global variable init
Thu May 17 17:24:35 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@ -6954,7 +6954,7 @@ Tue Mar 6 19:03:21 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* libxslt/preproc.[ch] Makefile.am templates.[ch] transform.[ch]
xsltInternals.h: started working on optimizing stylesheet
element parsing. Just builds the extra informations so far.
element parsing. Just builds the extra information so far.
* xsltutils.h: added a missing XPath decl
Tue Mar 6 09:52:13 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@ -7145,7 +7145,7 @@ Wed Feb 14 15:39:06 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
libxslt/xsltInternals.h libxslt/transform.[ch]
libxslt/templates.c libxslt/xslt.c:
Added apply-imports, keep a stack of running templates
* libxslt/xsltutils.c: bugfixes, gather the output informations
* libxslt/xsltutils.c: bugfixes, gather the output information
down the cascade
* tests/xmlspec/Makefile.am tests/xmlspec/REC-xml-2e.xsl
tests/xmlspec/diffspec.xsl tests/xmlspec/xmlspec.xsl: running
@ -7679,5 +7679,5 @@ Fri Jan 5 11:34:12 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Fri Jan 5 11:14:29 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* README: basic informations
* README: basic information
* Changelog: created

View file

@ -636,9 +636,11 @@ xsltResolveAttrSet(xsltAttrSetPtr set, xsltStylesheetPtr topStyle,
* resolve the references in an attribute set.
*/
static void
xsltResolveSASCallback(xsltAttrSetPtr set, xsltAttrSetContextPtr asctx,
xsltResolveSASCallback(void *payload, void *data,
const xmlChar *name, const xmlChar *ns,
ATTRIBUTE_UNUSED const xmlChar *ignored) {
xsltAttrSetPtr set = (xsltAttrSetPtr) payload;
xsltAttrSetContextPtr asctx = (xsltAttrSetContextPtr) data;
xsltStylesheetPtr topStyle = asctx->topStyle;
xsltStylesheetPtr style = asctx->style;
@ -685,8 +687,8 @@ xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style) {
style->attributeSets = xmlHashCreate(10);
}
asctx.style = cur;
xmlHashScanFull(cur->attributeSets,
(xmlHashScannerFull) xsltResolveSASCallback, &asctx);
xmlHashScanFull(cur->attributeSets, xsltResolveSASCallback,
&asctx);
if (cur != style) {
/*
@ -714,13 +716,13 @@ void
xsltAttribute(xsltTransformContextPtr ctxt,
xmlNodePtr contextNode,
xmlNodePtr inst,
xsltStylePreCompPtr castedComp)
xsltElemPreCompPtr castedComp)
{
#ifdef XSLT_REFACTORED
xsltStyleItemAttributePtr comp =
(xsltStyleItemAttributePtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
xmlNodePtr targetElem;
xmlChar *prop = NULL;
@ -1187,6 +1189,12 @@ xsltApplyAttributeSet(xsltTransformContextPtr ctxt, xmlNodePtr node,
}
}
static void
xsltFreeAttributeSetsEntry(void *payload,
const xmlChar *name ATTRIBUTE_UNUSED) {
xsltFreeAttrSet((xsltAttrSetPtr) payload);
}
/**
* xsltFreeAttributeSetsHashes:
* @style: an XSLT stylesheet
@ -1197,6 +1205,6 @@ void
xsltFreeAttributeSetsHashes(xsltStylesheetPtr style) {
if (style->attributeSets != NULL)
xmlHashFree((xmlHashTablePtr) style->attributeSets,
(xmlHashDeallocator) xsltFreeAttrSet);
xsltFreeAttributeSetsEntry);
style->attributeSets = NULL;
}

View file

@ -187,6 +187,11 @@ xsltFreeExtModule(xsltExtModulePtr ext)
xmlFree(ext);
}
static void
xsltFreeExtModuleEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
xsltFreeExtModule((xsltExtModulePtr) payload);
}
/**
* xsltNewExtData:
* @extModule: the module
@ -228,6 +233,11 @@ xsltFreeExtData(xsltExtDataPtr ext)
xmlFree(ext);
}
static void
xsltFreeExtDataEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
xsltFreeExtData((xsltExtDataPtr) payload);
}
/**
* xsltNewExtElement:
* @precomp: the pre-computation function
@ -272,6 +282,11 @@ xsltFreeExtElement(xsltExtElementPtr ext)
xmlFree(ext);
}
static void
xsltFreeExtElementEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
xsltFreeExtElement((xsltExtElementPtr) payload);
}
#ifdef WITH_MODULES
typedef void (*exsltRegisterFunction) (void);
@ -919,9 +934,10 @@ struct _xsltInitExtCtxt {
* Initializes an extension module
*/
static void
xsltInitCtxtExt(xsltExtDataPtr styleData, xsltInitExtCtxt * ctxt,
const xmlChar * URI)
xsltInitCtxtExt(void *payload, void *data, const xmlChar * URI)
{
xsltExtDataPtr styleData = (xsltExtDataPtr) payload;
xsltInitExtCtxt *ctxt = (xsltInitExtCtxt *) data;
xsltExtModulePtr module;
xsltExtDataPtr ctxtData;
void *extData;
@ -1014,8 +1030,7 @@ xsltInitCtxtExts(xsltTransformContextPtr ctxt)
while (style != NULL) {
if (style->extInfos != NULL) {
xmlHashScan(style->extInfos,
(xmlHashScanner) xsltInitCtxtExt, &ctx);
xmlHashScan(style->extInfos, xsltInitCtxtExt, &ctx);
if (ctx.ret == -1)
return (-1);
}
@ -1037,9 +1052,10 @@ xsltInitCtxtExts(xsltTransformContextPtr ctxt)
* Shutdown an extension module loaded
*/
static void
xsltShutdownCtxtExt(xsltExtDataPtr data, xsltTransformContextPtr ctxt,
const xmlChar * URI)
xsltShutdownCtxtExt(void *payload, void *vctxt, const xmlChar * URI)
{
xsltExtDataPtr data = (xsltExtDataPtr) payload;
xsltTransformContextPtr ctxt = (xsltTransformContextPtr) vctxt;
xsltExtModulePtr module;
if ((data == NULL) || (ctxt == NULL) || (URI == NULL))
@ -1068,9 +1084,8 @@ xsltShutdownCtxtExts(xsltTransformContextPtr ctxt)
return;
if (ctxt->extInfos == NULL)
return;
xmlHashScan(ctxt->extInfos, (xmlHashScanner) xsltShutdownCtxtExt,
ctxt);
xmlHashFree(ctxt->extInfos, (xmlHashDeallocator) xsltFreeExtData);
xmlHashScan(ctxt->extInfos, xsltShutdownCtxtExt, ctxt);
xmlHashFree(ctxt->extInfos, xsltFreeExtDataEntry);
ctxt->extInfos = NULL;
}
@ -1083,9 +1098,10 @@ xsltShutdownCtxtExts(xsltTransformContextPtr ctxt)
* Shutdown an extension module loaded
*/
static void
xsltShutdownExt(xsltExtDataPtr data, xsltStylesheetPtr style,
const xmlChar * URI)
xsltShutdownExt(void *payload, void *vctxt, const xmlChar * URI)
{
xsltExtDataPtr data = (xsltExtDataPtr) payload;
xsltStylesheetPtr style = (xsltStylesheetPtr) vctxt;
xsltExtModulePtr module;
if ((data == NULL) || (style == NULL) || (URI == NULL))
@ -1103,8 +1119,7 @@ xsltShutdownExt(xsltExtDataPtr data, xsltStylesheetPtr style,
* Don't remove the entry from the hash table here, since
* this will produce segfaults - this fixes bug #340624.
*
* xmlHashRemoveEntry(style->extInfos, URI,
* (xmlHashDeallocator) xsltFreeExtData);
* xmlHashRemoveEntry(style->extInfos, URI, xsltFreeExtDataEntry);
*/
}
@ -1121,8 +1136,8 @@ xsltShutdownExts(xsltStylesheetPtr style)
return;
if (style->extInfos == NULL)
return;
xmlHashScan(style->extInfos, (xmlHashScanner) xsltShutdownExt, style);
xmlHashFree(style->extInfos, (xmlHashDeallocator) xsltFreeExtData);
xmlHashScan(style->extInfos, xsltShutdownExt, style);
xmlHashFree(style->extInfos, xsltFreeExtDataEntry);
style->extInfos = NULL;
}
@ -1310,8 +1325,7 @@ xsltUnregisterExtModule(const xmlChar * URI)
xmlMutexLock(xsltExtMutex);
ret = xmlHashRemoveEntry(xsltExtensionsHash, URI,
(xmlHashDeallocator) xsltFreeExtModule);
ret = xmlHashRemoveEntry(xsltExtensionsHash, URI, xsltFreeExtModuleEntry);
xmlMutexUnlock(xsltExtMutex);
@ -1331,8 +1345,7 @@ xsltUnregisterAllExtModules(void)
xmlMutexLock(xsltExtMutex);
xmlHashFree(xsltExtensionsHash,
(xmlHashDeallocator) xsltFreeExtModule);
xmlHashFree(xsltExtensionsHash, xsltFreeExtModuleEntry);
xsltExtensionsHash = NULL;
xmlMutexUnlock(xsltExtMutex);
@ -1471,6 +1484,11 @@ xsltUnregisterAllExtModuleFunction(void)
}
static void
xsltFreeElemPreComp(xsltElemPreCompPtr comp) {
xmlFree(comp);
}
/**
* xsltNewElemPreComp:
* @style: the XSLT stylesheet
@ -1495,8 +1513,7 @@ xsltNewElemPreComp(xsltStylesheetPtr style, xmlNodePtr inst,
}
memset(cur, 0, sizeof(xsltElemPreComp));
xsltInitElemPreComp(cur, style, inst, function,
(xsltElemPreCompDeallocator) xmlFree);
xsltInitElemPreComp(cur, style, inst, function, xsltFreeElemPreComp);
return (cur);
}
@ -1628,7 +1645,7 @@ xsltRegisterExtModuleElement(const xmlChar * name, const xmlChar * URI,
}
xmlHashUpdateEntry2(xsltElementsHash, name, URI, (void *) ext,
(xmlHashDeallocator) xsltFreeExtElement);
xsltFreeExtElementEntry);
done:
xmlMutexUnlock(xsltExtMutex);
@ -1771,7 +1788,7 @@ xsltUnregisterExtModuleElement(const xmlChar * name, const xmlChar * URI)
xmlMutexLock(xsltExtMutex);
ret = xmlHashRemoveEntry2(xsltElementsHash, name, URI,
(xmlHashDeallocator) xsltFreeExtElement);
xsltFreeExtElementEntry);
xmlMutexUnlock(xsltExtMutex);
@ -1788,7 +1805,7 @@ xsltUnregisterAllExtModuleElement(void)
{
xmlMutexLock(xsltExtMutex);
xmlHashFree(xsltElementsHash, (xmlHashDeallocator) xsltFreeExtElement);
xmlHashFree(xsltElementsHash, xsltFreeExtElementEntry);
xsltElementsHash = NULL;
xmlMutexUnlock(xsltExtMutex);
@ -2046,7 +2063,7 @@ xsltExtElementPreCompTest(xsltStylesheetPtr style, xmlNodePtr inst,
* @ctxt: an XSLT processing context
* @node: The current node
* @inst: the instruction in the stylesheet
* @comp: precomputed informations
* @comp: precomputed information
*
* Process a libxslt:test node
*/
@ -2230,7 +2247,7 @@ xsltRegisterTestModule(void)
static void
xsltHashScannerModuleFree(void *payload ATTRIBUTE_UNUSED,
void *data ATTRIBUTE_UNUSED,
xmlChar * name ATTRIBUTE_UNUSED)
const xmlChar *name ATTRIBUTE_UNUSED)
{
#ifdef WITH_MODULES
xmlModuleClose(payload);
@ -2280,10 +2297,11 @@ xsltCleanupGlobals(void)
static void
xsltDebugDumpExtensionsCallback(void *function ATTRIBUTE_UNUSED,
FILE * output, const xmlChar * name,
void *data, const xmlChar * name,
const xmlChar * URI,
const xmlChar * not_used ATTRIBUTE_UNUSED)
{
FILE *output = (FILE *) data;
if (!name || !URI)
return;
fprintf(output, "{%s}%s\n", URI, name);
@ -2291,10 +2309,11 @@ xsltDebugDumpExtensionsCallback(void *function ATTRIBUTE_UNUSED,
static void
xsltDebugDumpExtModulesCallback(void *function ATTRIBUTE_UNUSED,
FILE * output, const xmlChar * URI,
void *data, const xmlChar * URI,
const xmlChar * not_used ATTRIBUTE_UNUSED,
const xmlChar * not_used2 ATTRIBUTE_UNUSED)
{
FILE *output = (FILE *) data;
if (!URI)
return;
fprintf(output, "%s\n", URI);
@ -2318,9 +2337,8 @@ xsltDebugDumpExtensions(FILE * output)
else {
fprintf(output, "Registered Extension Functions:\n");
xmlMutexLock(xsltExtMutex);
xmlHashScanFull(xsltFunctionsHash,
(xmlHashScannerFull)
xsltDebugDumpExtensionsCallback, output);
xmlHashScanFull(xsltFunctionsHash, xsltDebugDumpExtensionsCallback,
output);
xmlMutexUnlock(xsltExtMutex);
}
if (!xsltElementsHash)
@ -2328,9 +2346,8 @@ xsltDebugDumpExtensions(FILE * output)
else {
fprintf(output, "\nRegistered Extension Elements:\n");
xmlMutexLock(xsltExtMutex);
xmlHashScanFull(xsltElementsHash,
(xmlHashScannerFull)
xsltDebugDumpExtensionsCallback, output);
xmlHashScanFull(xsltElementsHash, xsltDebugDumpExtensionsCallback,
output);
xmlMutexUnlock(xsltExtMutex);
}
if (!xsltExtensionsHash)
@ -2338,9 +2355,8 @@ xsltDebugDumpExtensions(FILE * output)
else {
fprintf(output, "\nRegistered Extension Modules:\n");
xmlMutexLock(xsltExtMutex);
xmlHashScanFull(xsltExtensionsHash,
(xmlHashScannerFull)
xsltDebugDumpExtModulesCallback, output);
xmlHashScanFull(xsltExtensionsHash, xsltDebugDumpExtModulesCallback,
output);
xmlMutexUnlock(xsltExtMutex);
}

View file

@ -27,14 +27,14 @@
* @ctxt: an XSLT processing context
* @node: The current node
* @inst: the instruction in the stylesheet
* @comp: precomputed informations
* @comp: precomputed information
*
* Process an debug node
*/
void
xsltDebug(xsltTransformContextPtr ctxt, xmlNodePtr node ATTRIBUTE_UNUSED,
xmlNodePtr inst ATTRIBUTE_UNUSED,
xsltStylePreCompPtr comp ATTRIBUTE_UNUSED)
xsltElemPreCompPtr comp ATTRIBUTE_UNUSED)
{
int i, j;
@ -159,21 +159,21 @@ xsltRegisterAllExtras (void) {
xsltRegisterExtModuleElement((const xmlChar *) "debug",
XSLT_LIBXSLT_NAMESPACE,
NULL,
(xsltTransformFunction) xsltDebug);
xsltDebug);
xsltRegisterExtModuleElement((const xmlChar *) "output",
XSLT_SAXON_NAMESPACE,
xsltDocumentComp,
(xsltTransformFunction) xsltDocumentElem);
xsltDocumentElem);
xsltRegisterExtModuleElement((const xmlChar *) "write",
XSLT_XALAN_NAMESPACE,
xsltDocumentComp,
(xsltTransformFunction) xsltDocumentElem);
xsltDocumentElem);
xsltRegisterExtModuleElement((const xmlChar *) "document",
XSLT_XT_NAMESPACE,
xsltDocumentComp,
(xsltTransformFunction) xsltDocumentElem);
xsltDocumentElem);
xsltRegisterExtModuleElement((const xmlChar *) "document",
XSLT_NAMESPACE,
xsltDocumentComp,
(xsltTransformFunction) xsltDocumentElem);
xsltDocumentElem);
}

View file

@ -37,8 +37,9 @@
* Returns the callback function or NULL if not found
*/
xmlXPathFunction
xsltXPathFunctionLookup (xmlXPathContextPtr ctxt,
xsltXPathFunctionLookup (void *vctxt,
const xmlChar *name, const xmlChar *ns_uri) {
xmlXPathContextPtr ctxt = (xmlXPathContextPtr) vctxt;
xmlXPathFunction ret;
if ((ctxt == NULL) || (name == NULL) || (ns_uri == NULL))

View file

@ -28,8 +28,7 @@
static void xsltFixImportedCompSteps(xsltStylesheetPtr master,
xsltStylesheetPtr style) {
xsltStylesheetPtr res;
xmlHashScan(style->templatesHash,
(xmlHashScanner) xsltNormalizeCompSteps, master);
xmlHashScan(style->templatesHash, xsltNormalizeCompSteps, master);
master->extrasNr += style->extrasNr;
for (res = style->imports; res != NULL; res = res->next) {
xsltFixImportedCompSteps(master, res);
@ -292,7 +291,7 @@ xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt) {
* @ctxt: an XSLT transformation context
* @node: an XML node
*
* Find strip-space or preserve-space informations for an element
* Find strip-space or preserve-space information for an element
* respect the import precedence or the wildcards
*
* Returns 1 if space should be stripped, 0 if not, and 2 if everything

View file

@ -126,6 +126,11 @@ xsltNewKeyTable(const xmlChar *name, const xmlChar *nameURI) {
return(cur);
}
static void
xsltFreeNodeSetEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
xmlXPathFreeNodeSet((xmlNodeSetPtr) payload);
}
/**
* xsltFreeKeyTable:
* @keyt: an XSLT key table
@ -141,8 +146,7 @@ xsltFreeKeyTable(xsltKeyTablePtr keyt) {
if (keyt->nameURI != NULL)
xmlFree(keyt->nameURI);
if (keyt->keys != NULL)
xmlHashFree(keyt->keys,
(xmlHashDeallocator) xmlXPathFreeNodeSet);
xmlHashFree(keyt->keys, xsltFreeNodeSetEntry);
memset(keyt, -1, sizeof(xsltKeyTable));
xmlFree(keyt);
}

View file

@ -699,7 +699,7 @@ xsltNumberFormatGetValue(xmlXPathContextPtr context,
/**
* xsltNumberFormat:
* @ctxt: the XSLT transformation context
* @data: the formatting informations
* @data: the formatting information
* @node: the data to format
*
* Convert one number.
@ -869,7 +869,7 @@ xsltFormatNumberPreSuffix(xsltDecimalFormatPtr self, xmlChar **format, xsltForma
* @self: the decimal format
* @format: the format requested
* @number: the value to format
* @result: the place to ouput the result
* @result: the place to output the result
*
* format-number() uses the JDK 1.1 DecimalFormat class:
*

View file

@ -94,6 +94,7 @@ struct _xsltCompMatch {
xmlNsPtr *nsList; /* the namespaces in scope */
int nsNr; /* the number of namespaces in scope */
xsltStepOpPtr steps; /* ops for computation */
int novar; /* doesn't contain variables */
};
typedef struct _xsltParserContext xsltParserContext;
@ -199,6 +200,12 @@ xsltFreeCompMatchList(xsltCompMatchPtr comp) {
}
}
static void
xsltFreeCompMatchListEntry(void *payload,
const xmlChar *name ATTRIBUTE_UNUSED) {
xsltFreeCompMatchList((xsltCompMatchPtr) payload);
}
/**
* xsltNormalizeCompSteps:
* @payload: pointer to template hash table entry
@ -494,6 +501,11 @@ xsltPatPushState(xsltTransformContextPtr ctxt, xsltStepStates *states,
return(0);
}
static void
xmlXPathFreeObjectWrapper(void *obj) {
xmlXPathFreeObject((xmlXPathObjectPtr) obj);
}
/**
* xsltTestCompMatchDirect:
* @ctxt: a XSLT process context
@ -564,7 +576,8 @@ xsltTestCompMatchDirect(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp,
}
ix = 0;
if ((parent == NULL) || (node->doc == NULL) || isRVT)
if ((parent == NULL) || (node->doc == NULL) || isRVT ||
(comp->novar == 0))
nocache = 1;
if (nocache == 0) {
@ -579,7 +592,7 @@ xsltTestCompMatchDirect(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp,
XSLT_RUNTIME_EXTRA(ctxt, sel->indexExtra, ival) =
0;
XSLT_RUNTIME_EXTRA_FREE(ctxt, sel->lenExtra) =
(xmlFreeFunc) xmlXPathFreeObject;
xmlXPathFreeObjectWrapper;
} else
list = newlist;
}
@ -1940,6 +1953,7 @@ xsltCompilePatternInternal(const xmlChar *pattern, xmlDocPtr doc,
j++;
}
element->nsNr = j;
element->novar = novar;
#ifdef WITH_XSLT_DEBUG_PATTERN
@ -2559,7 +2573,7 @@ void
xsltFreeTemplateHashes(xsltStylesheetPtr style) {
if (style->templatesHash != NULL)
xmlHashFree((xmlHashTablePtr) style->templatesHash,
(xmlHashDeallocator) xsltFreeCompMatchList);
xsltFreeCompMatchListEntry);
if (style->rootMatch != NULL)
xsltFreeCompMatchList(style->rootMatch);
if (style->keyMatch != NULL)

View file

@ -295,40 +295,40 @@ xsltNewStylePreComp(xsltStylesheetPtr style, xsltStyleType type) {
cur->type = type;
switch (cur->type) {
case XSLT_FUNC_COPY:
cur->func = (xsltTransformFunction) xsltCopy;break;
cur->func = xsltCopy;break;
case XSLT_FUNC_SORT:
cur->func = (xsltTransformFunction) xsltSort;break;
cur->func = xsltSort;break;
case XSLT_FUNC_TEXT:
cur->func = (xsltTransformFunction) xsltText;break;
cur->func = xsltText;break;
case XSLT_FUNC_ELEMENT:
cur->func = (xsltTransformFunction) xsltElement;break;
cur->func = xsltElement;break;
case XSLT_FUNC_ATTRIBUTE:
cur->func = (xsltTransformFunction) xsltAttribute;break;
cur->func = xsltAttribute;break;
case XSLT_FUNC_COMMENT:
cur->func = (xsltTransformFunction) xsltComment;break;
cur->func = xsltComment;break;
case XSLT_FUNC_PI:
cur->func = (xsltTransformFunction) xsltProcessingInstruction;
cur->func = xsltProcessingInstruction;
break;
case XSLT_FUNC_COPYOF:
cur->func = (xsltTransformFunction) xsltCopyOf;break;
cur->func = xsltCopyOf;break;
case XSLT_FUNC_VALUEOF:
cur->func = (xsltTransformFunction) xsltValueOf;break;
cur->func = xsltValueOf;break;
case XSLT_FUNC_NUMBER:
cur->func = (xsltTransformFunction) xsltNumber;break;
cur->func = xsltNumber;break;
case XSLT_FUNC_APPLYIMPORTS:
cur->func = (xsltTransformFunction) xsltApplyImports;break;
cur->func = xsltApplyImports;break;
case XSLT_FUNC_CALLTEMPLATE:
cur->func = (xsltTransformFunction) xsltCallTemplate;break;
cur->func = xsltCallTemplate;break;
case XSLT_FUNC_APPLYTEMPLATES:
cur->func = (xsltTransformFunction) xsltApplyTemplates;break;
cur->func = xsltApplyTemplates;break;
case XSLT_FUNC_CHOOSE:
cur->func = (xsltTransformFunction) xsltChoose;break;
cur->func = xsltChoose;break;
case XSLT_FUNC_IF:
cur->func = (xsltTransformFunction) xsltIf;break;
cur->func = xsltIf;break;
case XSLT_FUNC_FOREACH:
cur->func = (xsltTransformFunction) xsltForEach;break;
cur->func = xsltForEach;break;
case XSLT_FUNC_DOCUMENT:
cur->func = (xsltTransformFunction) xsltDocumentElem;break;
cur->func = xsltDocumentElem;break;
case XSLT_FUNC_WITHPARAM:
case XSLT_FUNC_PARAM:
case XSLT_FUNC_VARIABLE:
@ -2045,7 +2045,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
case XSLT_FUNC_DOCUMENT:
/* The extra one */
node->psvi = (void *) xsltDocumentComp(style, node,
(xsltTransformFunction) xsltDocumentElem);
xsltDocumentElem);
break;
case XSLT_FUNC_MESSAGE:
/* NOP yet */
@ -2113,7 +2113,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
} else if (IS_XSLT_NAME(node, "document")) {
/* The extra one */
node->psvi = (void *) xsltDocumentComp(style, node,
(xsltTransformFunction) xsltDocumentElem);
xsltDocumentElem);
} else if (IS_XSLT_NAME(node, "output")) {
/* Top-level */
return;
@ -2315,7 +2315,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst) {
} else if (IS_XSLT_NAME(inst, "document")) {
xsltCheckInstructionElement(style, inst);
inst->psvi = (void *) xsltDocumentComp(style, inst,
(xsltTransformFunction) xsltDocumentElem);
xsltDocumentElem);
} else if ((style == NULL) || (style->forwards_compatible == 0)) {
xsltTransformError(NULL, style, inst,
"xsltStylePreCompute: unknown xsl:%s\n", inst->name);

View file

@ -2266,6 +2266,11 @@ xsltReleaseLocalRVTs(xsltTransformContextPtr ctxt, xmlDocPtr base)
if (cur->prev != NULL)
xsltTransformError(ctxt, NULL, NULL, "localRVT not head of list\n");
/* Reset localRVT early because some RVTs might be registered again. */
ctxt->localRVT = base;
if (base != NULL)
base->prev = NULL;
do {
tmp = cur;
cur = (xmlDocPtr) cur->next;
@ -2273,16 +2278,19 @@ xsltReleaseLocalRVTs(xsltTransformContextPtr ctxt, xmlDocPtr base)
xsltReleaseRVT(ctxt, tmp);
} else if (tmp->psvi == XSLT_RVT_GLOBAL) {
xsltRegisterPersistRVT(ctxt, tmp);
} else if (tmp->psvi != XSLT_RVT_FUNC_RESULT) {
} else if (tmp->psvi == XSLT_RVT_FUNC_RESULT) {
/*
* This will either register the RVT again or move it to the
* context variable.
*/
xsltRegisterLocalRVT(ctxt, tmp);
tmp->psvi = XSLT_RVT_FUNC_RESULT;
} else {
xmlGenericError(xmlGenericErrorContext,
"xsltReleaseLocalRVTs: Unexpected RVT flag %p\n",
tmp->psvi);
}
} while (cur != base);
if (base != NULL)
base->prev = NULL;
ctxt->localRVT = base;
}
/**
@ -2621,8 +2629,8 @@ xsltApplySequenceConstructor(xsltTransformContextPtr ctxt,
* Libxslt will now lookup if a handler is
* registered in the context of this transformation.
*/
func = (xsltTransformFunction)
xsltExtElementLookup(ctxt, cur->name, cur->ns->href);
func = xsltExtElementLookup(ctxt, cur->name,
cur->ns->href);
} else
func = ((xsltElemPreCompPtr) cur->psvi)->func;
@ -2807,8 +2815,8 @@ xsltApplySequenceConstructor(xsltTransformContextPtr ctxt,
* Flagged as an extension element
*/
if (cur->psvi == xsltExtMarker)
function = (xsltTransformFunction)
xsltExtElementLookup(ctxt, cur->name, cur->ns->href);
function = xsltExtElementLookup(ctxt, cur->name,
cur->ns->href);
else
function = ((xsltElemPreCompPtr) cur->psvi)->func;
@ -3325,12 +3333,12 @@ xsltApplyOneTemplate(xsltTransformContextPtr ctxt,
*/
void
xsltDocumentElem(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr castedComp)
xmlNodePtr inst, xsltElemPreCompPtr castedComp)
{
#ifdef XSLT_REFACTORED
xsltStyleItemDocumentPtr comp = (xsltStyleItemDocumentPtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
xsltStylesheetPtr style = NULL;
int ret;
@ -3839,7 +3847,7 @@ xsltDocumentElem(xsltTransformContextPtr ctxt, xmlNodePtr node,
void
xsltSort(xsltTransformContextPtr ctxt,
xmlNodePtr node ATTRIBUTE_UNUSED, xmlNodePtr inst,
xsltStylePreCompPtr comp) {
xsltElemPreCompPtr comp) {
if (comp == NULL) {
xsltTransformError(ctxt, NULL, inst,
"xsl:sort : compilation failed\n");
@ -3860,12 +3868,12 @@ xsltSort(xsltTransformContextPtr ctxt,
*/
void
xsltCopy(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr castedComp)
xmlNodePtr inst, xsltElemPreCompPtr castedComp)
{
#ifdef XSLT_REFACTORED
xsltStyleItemCopyPtr comp = (xsltStyleItemCopyPtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
xmlNodePtr copy, oldInsert;
@ -3979,7 +3987,7 @@ xsltCopy(xsltTransformContextPtr ctxt, xmlNodePtr node,
*/
void
xsltText(xsltTransformContextPtr ctxt, xmlNodePtr node ATTRIBUTE_UNUSED,
xmlNodePtr inst, xsltStylePreCompPtr comp ATTRIBUTE_UNUSED) {
xmlNodePtr inst, xsltElemPreCompPtr comp ATTRIBUTE_UNUSED) {
if ((inst->children != NULL) && (comp != NULL)) {
xmlNodePtr text = inst->children;
xmlNodePtr copy;
@ -4016,11 +4024,11 @@ xsltText(xsltTransformContextPtr ctxt, xmlNodePtr node ATTRIBUTE_UNUSED,
*/
void
xsltElement(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr castedComp) {
xmlNodePtr inst, xsltElemPreCompPtr castedComp) {
#ifdef XSLT_REFACTORED
xsltStyleItemElementPtr comp = (xsltStyleItemElementPtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
xmlChar *prop = NULL;
const xmlChar *name, *prefix = NULL, *nsName = NULL;
@ -4224,7 +4232,7 @@ error:
*/
void
xsltComment(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr comp ATTRIBUTE_UNUSED) {
xmlNodePtr inst, xsltElemPreCompPtr comp ATTRIBUTE_UNUSED) {
xmlChar *value = NULL;
xmlNodePtr commentNode;
int len;
@ -4268,11 +4276,11 @@ xsltComment(xsltTransformContextPtr ctxt, xmlNodePtr node,
*/
void
xsltProcessingInstruction(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr castedComp) {
xmlNodePtr inst, xsltElemPreCompPtr castedComp) {
#ifdef XSLT_REFACTORED
xsltStyleItemPIPtr comp = (xsltStyleItemPIPtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
const xmlChar *name;
xmlChar *value = NULL;
@ -4334,11 +4342,11 @@ error:
*/
void
xsltCopyOf(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr castedComp) {
xmlNodePtr inst, xsltElemPreCompPtr castedComp) {
#ifdef XSLT_REFACTORED
xsltStyleItemCopyOfPtr comp = (xsltStyleItemCopyOfPtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
xmlXPathObjectPtr res = NULL;
xmlNodeSetPtr list = NULL;
@ -4478,12 +4486,12 @@ xsltCopyOf(xsltTransformContextPtr ctxt, xmlNodePtr node,
*/
void
xsltValueOf(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr castedComp)
xmlNodePtr inst, xsltElemPreCompPtr castedComp)
{
#ifdef XSLT_REFACTORED
xsltStyleItemValueOfPtr comp = (xsltStyleItemValueOfPtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
xmlXPathObjectPtr res = NULL;
xmlChar *value = NULL;
@ -4552,12 +4560,12 @@ error:
*/
void
xsltNumber(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr castedComp)
xmlNodePtr inst, xsltElemPreCompPtr castedComp)
{
#ifdef XSLT_REFACTORED
xsltStyleItemNumberPtr comp = (xsltStyleItemNumberPtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
xmlXPathContextPtr xpctxt;
xmlNsPtr *oldXPNamespaces;
@ -4610,7 +4618,7 @@ xsltNumber(xsltTransformContextPtr ctxt, xmlNodePtr node,
void
xsltApplyImports(xsltTransformContextPtr ctxt, xmlNodePtr contextNode,
xmlNodePtr inst,
xsltStylePreCompPtr comp ATTRIBUTE_UNUSED)
xsltElemPreCompPtr comp ATTRIBUTE_UNUSED)
{
xsltTemplatePtr templ;
@ -4678,13 +4686,13 @@ xsltApplyImports(xsltTransformContextPtr ctxt, xmlNodePtr contextNode,
*/
void
xsltCallTemplate(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr castedComp)
xmlNodePtr inst, xsltElemPreCompPtr castedComp)
{
#ifdef XSLT_REFACTORED
xsltStyleItemCallTemplatePtr comp =
(xsltStyleItemCallTemplatePtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
xsltStackElemPtr withParams = NULL;
@ -4781,13 +4789,13 @@ xsltCallTemplate(xsltTransformContextPtr ctxt, xmlNodePtr node,
*/
void
xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr castedComp)
xmlNodePtr inst, xsltElemPreCompPtr castedComp)
{
#ifdef XSLT_REFACTORED
xsltStyleItemApplyTemplatesPtr comp =
(xsltStyleItemApplyTemplatesPtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
int i;
xmlNodePtr cur, delNode = NULL, oldContextNode;
@ -5158,7 +5166,7 @@ error:
*/
void
xsltChoose(xsltTransformContextPtr ctxt, xmlNodePtr contextNode,
xmlNodePtr inst, xsltStylePreCompPtr comp ATTRIBUTE_UNUSED)
xmlNodePtr inst, xsltElemPreCompPtr comp ATTRIBUTE_UNUSED)
{
xmlNodePtr cur;
@ -5317,14 +5325,14 @@ error:
*/
void
xsltIf(xsltTransformContextPtr ctxt, xmlNodePtr contextNode,
xmlNodePtr inst, xsltStylePreCompPtr castedComp)
xmlNodePtr inst, xsltElemPreCompPtr castedComp)
{
int res = 0;
#ifdef XSLT_REFACTORED
xsltStyleItemIfPtr comp = (xsltStyleItemIfPtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
if ((ctxt == NULL) || (contextNode == NULL) || (inst == NULL))
@ -5423,12 +5431,12 @@ error:
*/
void
xsltForEach(xsltTransformContextPtr ctxt, xmlNodePtr contextNode,
xmlNodePtr inst, xsltStylePreCompPtr castedComp)
xmlNodePtr inst, xsltElemPreCompPtr castedComp)
{
#ifdef XSLT_REFACTORED
xsltStyleItemForEachPtr comp = (xsltStyleItemForEachPtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
#endif
int i;
xmlXPathObjectPtr res = NULL;
@ -6343,6 +6351,12 @@ xsltRunStylesheet(xsltStylesheetPtr style, xmlDocPtr doc,
NULL, NULL));
}
static void
xsltMessageWrapper(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltElemPreCompPtr comp ATTRIBUTE_UNUSED) {
xsltMessage(ctxt, node, inst);
}
/**
* xsltRegisterAllElement:
* @ctxt: the XPath context
@ -6354,79 +6368,79 @@ xsltRegisterAllElement(xsltTransformContextPtr ctxt)
{
xsltRegisterExtElement(ctxt, (const xmlChar *) "apply-templates",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltApplyTemplates);
xsltApplyTemplates);
xsltRegisterExtElement(ctxt, (const xmlChar *) "apply-imports",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltApplyImports);
xsltApplyImports);
xsltRegisterExtElement(ctxt, (const xmlChar *) "call-template",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltCallTemplate);
xsltCallTemplate);
xsltRegisterExtElement(ctxt, (const xmlChar *) "element",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltElement);
xsltElement);
xsltRegisterExtElement(ctxt, (const xmlChar *) "attribute",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltAttribute);
xsltAttribute);
xsltRegisterExtElement(ctxt, (const xmlChar *) "text",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltText);
xsltText);
xsltRegisterExtElement(ctxt, (const xmlChar *) "processing-instruction",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltProcessingInstruction);
xsltProcessingInstruction);
xsltRegisterExtElement(ctxt, (const xmlChar *) "comment",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltComment);
xsltComment);
xsltRegisterExtElement(ctxt, (const xmlChar *) "copy",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltCopy);
xsltCopy);
xsltRegisterExtElement(ctxt, (const xmlChar *) "value-of",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltValueOf);
xsltValueOf);
xsltRegisterExtElement(ctxt, (const xmlChar *) "number",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltNumber);
xsltNumber);
xsltRegisterExtElement(ctxt, (const xmlChar *) "for-each",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltForEach);
xsltForEach);
xsltRegisterExtElement(ctxt, (const xmlChar *) "if",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltIf);
xsltIf);
xsltRegisterExtElement(ctxt, (const xmlChar *) "choose",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltChoose);
xsltChoose);
xsltRegisterExtElement(ctxt, (const xmlChar *) "sort",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltSort);
xsltSort);
xsltRegisterExtElement(ctxt, (const xmlChar *) "copy-of",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltCopyOf);
xsltCopyOf);
xsltRegisterExtElement(ctxt, (const xmlChar *) "message",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltMessage);
xsltMessageWrapper);
/*
* Those don't have callable entry points but are registered anyway
*/
xsltRegisterExtElement(ctxt, (const xmlChar *) "variable",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltDebug);
xsltDebug);
xsltRegisterExtElement(ctxt, (const xmlChar *) "param",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltDebug);
xsltDebug);
xsltRegisterExtElement(ctxt, (const xmlChar *) "with-param",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltDebug);
xsltDebug);
xsltRegisterExtElement(ctxt, (const xmlChar *) "decimal-format",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltDebug);
xsltDebug);
xsltRegisterExtElement(ctxt, (const xmlChar *) "when",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltDebug);
xsltDebug);
xsltRegisterExtElement(ctxt, (const xmlChar *) "otherwise",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltDebug);
xsltDebug);
xsltRegisterExtElement(ctxt, (const xmlChar *) "fallback",
XSLT_NAMESPACE,
(xsltTransformFunction) xsltDebug);
xsltDebug);
}

View file

@ -102,7 +102,7 @@ xsltRegisterTmpRVT(xsltTransformContextPtr ctxt, xmlDocPtr RVT)
return(-1);
RVT->prev = NULL;
RVT->psvi = XSLT_RVT_VARIABLE;
RVT->psvi = XSLT_RVT_LOCAL;
/*
* We'll restrict the lifetime of user-created fragments
@ -142,6 +142,7 @@ xsltRegisterLocalRVT(xsltTransformContextPtr ctxt,
return(-1);
RVT->prev = NULL;
RVT->psvi = XSLT_RVT_LOCAL;
/*
* When evaluating "select" expressions of xsl:variable
@ -152,7 +153,6 @@ xsltRegisterLocalRVT(xsltTransformContextPtr ctxt,
if ((ctxt->contextVariable != NULL) &&
(XSLT_TCTXT_VARIABLE(ctxt)->flags & XSLT_VAR_IN_SELECT))
{
RVT->psvi = XSLT_RVT_VARIABLE;
RVT->next = (xmlNodePtr) XSLT_TCTXT_VARIABLE(ctxt)->fragment;
XSLT_TCTXT_VARIABLE(ctxt)->fragment = RVT;
return(0);
@ -162,7 +162,6 @@ xsltRegisterLocalRVT(xsltTransformContextPtr ctxt,
* If not reference by a returning instruction (like EXSLT's function),
* then this fragment will be freed, when the instruction exits.
*/
RVT->psvi = XSLT_RVT_LOCAL;
RVT->next = (xmlNodePtr) ctxt->localRVT;
if (ctxt->localRVT != NULL)
ctxt->localRVT->prev = (xmlNodePtr) RVT;
@ -293,14 +292,8 @@ xsltFlagRVTs(xsltTransformContextPtr ctxt, xmlXPathObjectPtr obj, void *val) {
#endif
if (val == XSLT_RVT_LOCAL) {
if (doc->psvi != XSLT_RVT_FUNC_RESULT) {
xmlGenericError(xmlGenericErrorContext,
"xsltFlagRVTs: Invalid transition %p => LOCAL\n",
doc->psvi);
return(-1);
}
xsltRegisterLocalRVT(ctxt, doc);
if (doc->psvi == XSLT_RVT_FUNC_RESULT)
doc->psvi = XSLT_RVT_LOCAL;
} else if (val == XSLT_RVT_GLOBAL) {
if (doc->psvi != XSLT_RVT_LOCAL) {
xmlGenericError(xmlGenericErrorContext,
@ -564,10 +557,12 @@ xsltFreeStackElem(xsltStackElemPtr elem) {
cur = elem->fragment;
elem->fragment = (xmlDocPtr) cur->next;
if (cur->psvi == XSLT_RVT_VARIABLE) {
xsltReleaseRVT((xsltTransformContextPtr) elem->context,
cur);
} else if (cur->psvi != XSLT_RVT_FUNC_RESULT) {
if (cur->psvi == XSLT_RVT_LOCAL) {
xsltReleaseRVT(elem->context, cur);
} else if (cur->psvi == XSLT_RVT_FUNC_RESULT) {
xsltRegisterLocalRVT(elem->context, cur);
cur->psvi = XSLT_RVT_FUNC_RESULT;
} else {
xmlGenericError(xmlGenericErrorContext,
"xsltFreeStackElem: Unexpected RVT flag %p\n",
cur->psvi);
@ -595,6 +590,12 @@ xsltFreeStackElem(xsltStackElemPtr elem) {
xmlFree(elem);
}
static void
xsltFreeStackElemEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
xsltFreeStackElem((xsltStackElemPtr) payload);
}
/**
* xsltFreeStackElemList:
* @elem: an XSLT stack element
@ -965,7 +966,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
* the Result Tree Fragment.
*/
variable->fragment = container;
container->psvi = XSLT_RVT_VARIABLE;
container->psvi = XSLT_RVT_LOCAL;
oldOutput = ctxt->output;
oldInsert = ctxt->insert;
@ -1234,6 +1235,13 @@ error:
return(result);
}
static void
xsltEvalGlobalVariableWrapper(void *payload, void *data,
const xmlChar *name ATTRIBUTE_UNUSED) {
xsltEvalGlobalVariable((xsltStackElemPtr) payload,
(xsltTransformContextPtr) data);
}
/**
* xsltEvalGlobalVariables:
* @ctxt: the XSLT transformation context
@ -1308,8 +1316,7 @@ xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) {
/*
* This part does the actual evaluation
*/
xmlHashScan(ctxt->globalVars,
(xmlHashScanner) xsltEvalGlobalVariable, ctxt);
xmlHashScan(ctxt->globalVars, xsltEvalGlobalVariableWrapper, ctxt);
return(0);
}
@ -2213,7 +2220,7 @@ xsltParseStylesheetParam(xsltTransformContextPtr ctxt, xmlNodePtr cur)
void
xsltFreeGlobalVariables(xsltTransformContextPtr ctxt) {
xmlHashFree(ctxt->globalVars, (xmlHashDeallocator) xsltFreeStackElem);
xmlHashFree(ctxt->globalVars, xsltFreeStackElemEntry);
}
/**

View file

@ -3696,7 +3696,7 @@ xsltGatherNamespaces(xsltStylesheetPtr style) {
style->warnings++;
} else if (URI == NULL) {
xmlHashUpdateEntry(style->nsHash, ns->prefix,
(void *) ns->href, (xmlHashDeallocator)xmlFree);
(void *) ns->href, NULL);
#ifdef WITH_XSLT_DEBUG_PARSING
xsltGenericDebug(xsltGenericDebugContext,

View file

@ -1,6 +1,6 @@
/*
* Summary: compile-time version informations for the XSLT engine
* Description: compile-time version informations for the XSLT engine
* Summary: compile-time version information for the XSLT engine
* Description: compile-time version information for the XSLT engine
* this module is autogenerated.
*
* Copy: See Copyright for the status of this software.

View file

@ -1438,7 +1438,7 @@ xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result,
((style->method == NULL) ||
(!xmlStrEqual(style->method, (const xmlChar *) "xhtml")))) {
xsltGenericError(xsltGenericErrorContext,
"xsltSaveResultTo : unknown ouput method\n");
"xsltSaveResultTo : unknown output method\n");
return(-1);
}
@ -1766,7 +1766,7 @@ xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len,
/************************************************************************
* *
* Generating profiling informations *
* Generating profiling information *
* *
************************************************************************/
@ -1929,9 +1929,9 @@ pretty_templ_match(xsltTemplatePtr templ) {
/**
* xsltSaveProfiling:
* @ctxt: an XSLT context
* @output: a FILE * for saving the informations
* @output: a FILE * for saving the information
*
* Save the profiling informations on @output
* Save the profiling information on @output
*/
void
xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output) {
@ -2128,7 +2128,7 @@ xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output) {
/************************************************************************
* *
* Fetching profiling informations *
* Fetching profiling information *
* *
************************************************************************/
@ -2137,8 +2137,8 @@ xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output) {
* @ctxt: a transformation context
*
* This function should be called after the transformation completed
* to extract template processing profiling informations if availble.
* The informations are returned as an XML document tree like
* to extract template processing profiling information if available.
* The information is returned as an XML document tree like
* <?xml version="1.0"?>
* <profile>
* <template rank="1" match="*" name=""

View file

@ -1,7 +1,7 @@
/*
* Summary: compile-time version informations for the XSLT engine
* Summary: compile-time version information for the XSLT engine
* when compiled on windows
* Description: compile-time version informations for the XSLT engine
* Description: compile-time version information for the XSLT engine
* when compiled on windows. This file is generated.
*
* Copy: See Copyright for the status of this software.
@ -23,21 +23,21 @@ extern "C" {
*
* the version string like "1.2.3"
*/
#define LIBXSLT_DOTTED_VERSION "1.1.32"
#define LIBXSLT_DOTTED_VERSION "1.1.33"
/**
* LIBXSLT_VERSION:
*
* the version number: 1.2.3 value is 1002003
*/
#define LIBXSLT_VERSION 10132
#define LIBXSLT_VERSION 10133
/**
* LIBXSLT_VERSION_STRING:
*
* the version number string, 1.2.3 value is "1002003"
*/
#define LIBXSLT_VERSION_STRING "10132"
#define LIBXSLT_VERSION_STRING "10133"
/**
* LIBXSLT_VERSION_EXTRA:

View file

@ -1,7 +1,7 @@
/*
* Summary: compile-time version informations for the XSLT engine
* Summary: compile-time version information for the XSLT engine
* when compiled on windows
* Description: compile-time version informations for the XSLT engine
* Description: compile-time version information for the XSLT engine
* when compiled on windows. This file is generated.
*
* Copy: See Copyright for the status of this software.

View file

@ -56,7 +56,7 @@ XSLTPUBFUN void XSLTCALL
xsltDebug (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL

View file

@ -26,11 +26,11 @@ extern "C" {
*/
#define XSLT_REGISTER_FUNCTION_LOOKUP(ctxt) \
xmlXPathRegisterFuncLookup((ctxt)->xpathCtxt, \
(xmlXPathFuncLookupFunc) xsltXPathFunctionLookup, \
xsltXPathFunctionLookup, \
(void *)(ctxt->xpathCtxt));
XSLTPUBFUN xmlXPathFunction XSLTCALL
xsltXPathFunctionLookup (xmlXPathContextPtr ctxt,
xsltXPathFunctionLookup (void *vctxt,
const xmlChar *name,
const xmlChar *ns_uri);

View file

@ -91,87 +91,87 @@ XSLTPUBFUN void XSLTCALL
xsltDocumentElem (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltSort (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltCopy (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltText (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltElement (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltComment (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltAttribute (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltProcessingInstruction(xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltCopyOf (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltValueOf (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltNumber (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltApplyImports (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltCallTemplate (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltApplyTemplates (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltChoose (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltIf (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltForEach (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltStylePreCompPtr comp);
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltRegisterAllElement (xsltTransformContextPtr ctxt);

View file

@ -45,14 +45,6 @@ extern "C" {
*/
#define XSLT_RVT_LOCAL ((void *)1)
/**
* XSLT_RVT_VARIABLE:
*
* RVT is part of a local variable and destroyed after the variable goes out
* of scope.
*/
#define XSLT_RVT_VARIABLE ((void *)2)
/**
* XSLT_RVT_FUNC_RESULT:
*
@ -60,14 +52,14 @@ extern "C" {
* destroyed after exiting a template and will be reset to XSLT_RVT_LOCAL or
* XSLT_RVT_VARIABLE in the template that receives the return value.
*/
#define XSLT_RVT_FUNC_RESULT ((void *)3)
#define XSLT_RVT_FUNC_RESULT ((void *)2)
/**
* XSLT_RVT_GLOBAL:
*
* RVT is part of a global variable.
*/
#define XSLT_RVT_GLOBAL ((void *)4)
#define XSLT_RVT_GLOBAL ((void *)3)
/*
* Interfaces for the variable module.

View file

@ -290,7 +290,7 @@ struct _xsltTemplate {
int inheritedNsNr; /* number of inherited namespaces */
xmlNsPtr *inheritedNs;/* inherited non-excluded namespaces */
/* Profiling informations */
/* Profiling information */
int nbCalls; /* the number of time the template was called */
unsigned long time; /* the time spent in this template */
void *params; /* xsl:param instructions */
@ -1513,7 +1513,7 @@ struct _xsltStylesheet {
*/
xsltTemplatePtr templates; /* the ordered list of templates */
void *templatesHash; /* hash table or wherever compiled templates
informations are stored */
information is stored */
void *rootMatch; /* template based on / */
void *keyMatch; /* template based on key() */
void *elemMatch; /* template based on * */
@ -1733,7 +1733,7 @@ struct _xsltTransformContext {
int extrasNr; /* the number of extras used */
int extrasMax; /* the number of extras allocated */
xsltRuntimeExtraPtr extras; /* extra per runtime informations */
xsltRuntimeExtraPtr extras; /* extra per runtime information */
xsltDocumentPtr styleList; /* the stylesheet docs list */
void * sec; /* the security preferences if any */

View file

@ -1,6 +1,6 @@
/*
* Summary: compile-time version informations for the XSLT engine
* Description: compile-time version informations for the XSLT engine
* Summary: compile-time version information for the XSLT engine
* Description: compile-time version information for the XSLT engine
* this module is autogenerated.
*
* Copy: See Copyright for the status of this software.
@ -20,21 +20,21 @@ extern "C" {
*
* the version string like "1.2.3"
*/
#define LIBXSLT_DOTTED_VERSION "1.1.32"
#define LIBXSLT_DOTTED_VERSION "1.1.33"
/**
* LIBXSLT_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXSLT_VERSION 10132
#define LIBXSLT_VERSION 10133
/**
* LIBXSLT_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXSLT_VERSION_STRING "10132"
#define LIBXSLT_VERSION_STRING "10133"
/**
* LIBXSLT_VERSION_EXTRA:

View file

@ -113,8 +113,8 @@
#endif
#endif
/* Cygwin platform, GNU compiler */
#if defined(_WIN32) && defined(__CYGWIN__)
/* Cygwin platform (does not define _WIN32), GNU compiler */
#if defined(__CYGWIN__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
@ -126,7 +126,7 @@
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl