* daniel@veillard.com
*/
-#define IN_LIBXSLT
-#include "libxslt.h"
-
-#include <string.h>
-
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <libxml/valid.h>
-#include <libxml/hash.h>
-#include <libxml/uri.h>
-#include <libxml/encoding.h>
-#include <libxml/xmlerror.h>
-#include "xslt.h"
-#include "xsltutils.h"
-#include "xsltInternals.h"
-#include "transform.h"
-#include "templates.h"
-#include "variables.h"
-#include "numbersInternals.h"
-#include "preproc.h"
-#include "extra.h"
-#include "imports.h"
-#include "extensions.h"
+#include "precomp.h"
#ifdef WITH_XSLT_DEBUG
#define WITH_XSLT_DEBUG_PREPROC
xmlNodePtr parent;
if ((style == NULL) || (inst == NULL) || (inst->ns == NULL))
return(-1);
-
+
parent = inst->parent;
if (parent == NULL) {
if (err) {
return;
has_ext = (style->extInfos != NULL);
-
+
parent = inst->parent;
if (parent == NULL) {
xsltTransformError(NULL, style, inst,
if ((has_ext) && (parent->ns != NULL) &&
(xmlHashLookup(style->extInfos, parent->ns->href) != NULL))
return;
-
+
parent = parent->parent;
}
xsltTransformError(NULL, style, inst,
if ((parent->ns != NULL) &&
(xmlHashLookup(style->extInfos, parent->ns->href) != NULL))
return;
-
+
parent = parent->parent;
}
}
if (style == NULL)
return(NULL);
-
+
#ifdef XSLT_REFACTORED
/*
* URGENT TODO: Use specialized factory functions in order
size = sizeof(xsltStyleItemWhen); break;
case XSLT_FUNC_OTHERWISE:
size = sizeof(xsltStyleItemOtherwise); break;
- default:
+ default:
xsltTransformError(NULL, style, NULL,
"xsltNewStylePreComp : invalid type %d\n", type);
style->errors++;
case XSLT_FUNC_DOCUMENT:
cur->func = (xsltTransformFunction) xsltDocumentElem;break;
case XSLT_FUNC_WITHPARAM:
- case XSLT_FUNC_PARAM:
- case XSLT_FUNC_VARIABLE:
+ case XSLT_FUNC_PARAM:
+ case XSLT_FUNC_VARIABLE:
case XSLT_FUNC_WHEN:
break;
default:
xmlXPathFreeCompExpr(item->comp);
}
break;
- case XSLT_FUNC_NUMBER:
+ case XSLT_FUNC_NUMBER: {
+ xsltStyleItemNumberPtr item = (xsltStyleItemNumberPtr) comp;
+ if (item->numdata.countPat != NULL)
+ xsltFreeCompMatchList(item->numdata.countPat);
+ if (item->numdata.fromPat != NULL)
+ xsltFreeCompMatchList(item->numdata.fromPat);
+ }
break;
case XSLT_FUNC_APPLYIMPORTS:
break;
xmlXPathFreeCompExpr(item->comp);
}
break;
- case XSLT_FUNC_OTHERWISE:
+ case XSLT_FUNC_OTHERWISE:
case XSLT_FUNC_FALLBACK:
case XSLT_FUNC_MESSAGE:
case XSLT_FUNC_INCLUDE:
case XSLT_FUNC_ATTRSET:
-
+
break;
default:
/* TODO: Raise error. */
break;
}
-#else
+#else
if (comp->locale != (xsltLocale)0)
xsltFreeLocale(comp->locale);
if (comp->comp != NULL)
xmlXPathFreeCompExpr(comp->comp);
+ if (comp->numdata.countPat != NULL)
+ xsltFreeCompMatchList(comp->numdata.countPat);
+ if (comp->numdata.fromPat != NULL)
+ xsltFreeCompMatchList(comp->numdata.fromPat);
if (comp->nsList != NULL)
xmlFree(comp->nsList);
#endif
#else
comp = xsltNewStylePreComp(style, XSLT_FUNC_DOCUMENT);
#endif
-
+
if (comp == NULL)
return (NULL);
comp->inst = inst;
#ifdef WITH_XSLT_DEBUG_EXTRA
xsltGenericDebug(xsltGenericDebugContext,
"Found xslt11:document construct\n");
-#endif
- } else {
+#endif
+ } else {
if (xmlStrEqual(inst->ns->href,
(const xmlChar *)"http://exslt.org/common")) {
/* EXSLT. */
* 3) XSLT_XT_NAMESPACE (http://www.jclark.com/xt)
* Example: <xt:document method="xml" href="myFile.xml">
* TODO: is @href is an AVT?
- *
+ *
* In all cases @href is in no namespace.
*/
filename = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"href", NULL, &comp->has_filename);
- }
+ }
if (!comp->has_filename) {
goto error;
}
#else
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
#else
comp = xsltNewStylePreComp(style, XSLT_FUNC_SORT);
#endif
-
+
if (comp == NULL)
return;
inst->psvi = comp;
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
comp = (xsltStyleItemCopyPtr) xsltNewStylePreComp(style, XSLT_FUNC_COPY);
#else
comp = xsltNewStylePreComp(style, XSLT_FUNC_COPY);
#endif
-
+
if (comp == NULL)
return;
inst->psvi = comp;
#endif
const xmlChar *prop;
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
comp = (xsltStyleItemTextPtr) xsltNewStylePreComp(style, XSLT_FUNC_TEXT);
#else
comp = xsltNewStylePreComp(style, XSLT_FUNC_TEXT);
-#endif
+#endif
if (comp == NULL)
return;
inst->psvi = comp;
* <!-- Content: template -->
* </xsl:element>
*/
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
*/
comp->ns = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"namespace", NULL, &comp->has_ns);
-
- if (comp->name != NULL) {
+
+ if (comp->name != NULL) {
if (xmlValidateQName(comp->name, 0)) {
xsltTransformError(NULL, style, inst,
"xsl:element: The value '%s' of the attribute 'name' is "
const xmlChar *prefix = NULL, *name;
name = xsltSplitQName(style->dict, comp->name, &prefix);
- if (comp->has_ns == 0) {
+ if (comp->has_ns == 0) {
xmlNsPtr ns;
/*
* expanded into an expanded-name using the namespace declarations
* in effect for the xsl:element element, including any default
* namespace declaration.
- */
+ */
ns = xmlSearchNs(inst->doc, inst, prefix);
if (ns != NULL) {
comp->ns = xmlDictLookup(style->dict, ns->href, -1);
#ifdef XSLT_REFACTORED
comp->nsPrefix = prefix;
comp->name = name;
+#else
+ (void)name; /* Suppress unused variable warning. */
#endif
} else if (prefix != NULL) {
xsltTransformError(NULL, style, inst,
"not specified by the instruction itself.\n", comp->name);
style->errors++;
}
- }
+ }
if ((prefix != NULL) &&
(!xmlStrncasecmp(prefix, (xmlChar *)"xml", 3)))
{
/*
* Mark is to be skipped.
*/
- comp->has_name = 0;
+ comp->has_name = 0;
}
}
- }
+ }
/*
* Attribute "use-attribute-sets",
*/
(const xmlChar *)"use-attribute-sets",
NULL, &comp->has_use);
-error:
+error:
return;
}
* <!-- Content: template -->
* </xsl:attribute>
*/
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
#else
comp = xsltNewStylePreComp(style, XSLT_FUNC_ATTRIBUTE);
#endif
-
+
if (comp == NULL)
return;
inst->psvi = comp;
"XSLT-attribute: The attribute 'name' is missing.\n");
style->errors++;
return;
- }
+ }
/*
* Attribute "namespace".
*/
"xsl:attribute: The value '%s' of the attribute 'name' is "
"not a valid QName.\n", comp->name);
style->errors++;
+ } else if (xmlStrEqual(comp->name, BAD_CAST "xmlns")) {
+ xsltTransformError(NULL, style, inst,
+ "xsl:attribute: The attribute name 'xmlns' is not allowed.\n");
+ style->errors++;
} else {
const xmlChar *prefix = NULL, *name;
* QName is expanded into an expanded-name using the
* namespace declarations in effect for the xsl:element
* element, including any default namespace declaration.
- */
+ */
ns = xmlSearchNs(inst->doc, inst, prefix);
if (ns != NULL) {
comp->ns = xmlDictLookup(style->dict, ns->href, -1);
#ifdef XSLT_REFACTORED
comp->nsPrefix = prefix;
comp->name = name;
+#else
+ (void)name; /* Suppress unused variable warning. */
#endif
} else {
xsltTransformError(NULL, style, inst,
style->errors++;
}
}
- if (!xmlStrncasecmp(prefix, (xmlChar *) "xmlns", 5)) {
- /*
- * SPEC XSLT 1.0:
- * "It is an error if the string that results from
- * instantiating the attribute value template is not a
- * QName or is the string xmlns. An XSLT processor may
- * signal the error; if it does not signal the error,
- * it must recover by not adding the attribute to the
- * result tree."
- *
- * Reject a prefix of "xmlns". Mark to be skipped.
- */
- comp->has_name = 0;
-
-#ifdef WITH_XSLT_DEBUG_PARSING
- xsltGenericDebug(xsltGenericDebugContext,
- "xsltAttribute: xmlns prefix forbidden\n");
-#endif
- return;
- }
-
}
- }
+ }
}
}
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
#endif
const xmlChar *prop;
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
if (prop == NULL) {
style->errors++;
} else {
- *localName = prop;
+ if (localName)
+ *localName = prop;
if (hasProp)
*hasProp = 1;
if (URI != NULL) {
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
#endif
const xmlChar *prop;
- if ((style == NULL) || (cur == NULL))
+ if ((style == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
return;
cur->psvi = comp;
- if ((style == NULL) || (cur == NULL))
- return;
-
comp->numdata.doc = cur->doc;
comp->numdata.node = cur;
comp->numdata.value = xsltGetCNsProp(style, cur, (const xmlChar *)"value",
XSLT_NAMESPACE);
-
+
prop = xsltEvalStaticAttrValueTemplate(style, cur,
(const xmlChar *)"format",
XSLT_NAMESPACE, &comp->numdata.has_format);
}
comp->numdata.count = xsltGetCNsProp(style, cur, (const xmlChar *)"count",
- XSLT_NAMESPACE);
+ XSLT_NAMESPACE);
comp->numdata.from = xsltGetCNsProp(style, cur, (const xmlChar *)"from",
- XSLT_NAMESPACE);
-
+ XSLT_NAMESPACE);
+
+ prop = xsltGetCNsProp(style, cur, (const xmlChar *)"count", XSLT_NAMESPACE);
+ if (prop != NULL) {
+ comp->numdata.countPat = xsltCompilePattern(prop, cur->doc, cur, style,
+ NULL);
+ }
+
+ prop = xsltGetCNsProp(style, cur, (const xmlChar *)"from", XSLT_NAMESPACE);
+ if (prop != NULL) {
+ comp->numdata.fromPat = xsltCompilePattern(prop, cur->doc, cur, style,
+ NULL);
+ }
+
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"level", XSLT_NAMESPACE);
if (prop != NULL) {
if (xmlStrEqual(prop, BAD_CAST("single")) ||
if (style != NULL) style->warnings++;
}
}
-
+
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"lang", XSLT_NAMESPACE);
if (prop != NULL) {
xsltTransformError(NULL, style, cur,
"xsl:number : lang attribute not implemented\n");
XSLT_TODO; /* xsl:number lang attribute */
}
-
+
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"letter-value", XSLT_NAMESPACE);
if (prop != NULL) {
if (xmlStrEqual(prop, BAD_CAST("alphabetic"))) {
if (style != NULL) style->warnings++;
}
}
-
+
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"grouping-separator",
XSLT_NAMESPACE);
if (prop != NULL) {
comp->numdata.groupingCharacter =
xsltGetUTF8Char(prop, &(comp->numdata.groupingCharacterLen));
}
-
+
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"grouping-size", XSLT_NAMESPACE);
if (prop != NULL) {
sscanf((char *)prop, "%d", &comp->numdata.digitsPerGroup);
BAD_CAST"single", 6);
}
}
-
+
}
/**
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltGetQNameProperty(style, inst, BAD_CAST "name",
1, &(comp->has_name), &(comp->ns), &(comp->name));
if (comp->ns)
- comp->has_ns = 1;
+ comp->has_ns = 1;
/*
* Attribute "select".
*/
comp->select = xsltGetCNsProp(style, inst, (const xmlChar *)"select",
XSLT_NAMESPACE);
if (comp->select != NULL) {
+#ifndef XSLT_REFACTORED
+ xmlNodePtr cur;
+#endif
comp->comp = xsltXPathCompile(style, comp->select);
if (comp->comp == NULL) {
xsltTransformError(NULL, style, inst,
comp->select);
style->errors++;
}
+#ifdef XSLT_REFACTORED
if (inst->children != NULL) {
xsltTransformError(NULL, style, inst,
- "XSLT-variable: The must be no child nodes, since the "
+ "XSLT-variable: There must be no child nodes, since the "
"attribute 'select' was specified.\n");
style->errors++;
}
+#else
+ for (cur = inst->children; cur != NULL; cur = cur->next) {
+ if (cur->type != XML_COMMENT_NODE &&
+ (cur->type != XML_TEXT_NODE || !xsltIsBlank(cur->content)))
+ {
+ xsltTransformError(NULL, style, inst,
+ "XSLT-variable: There must be no child nodes, since the "
+ "attribute 'select' was specified.\n");
+ style->errors++;
+ }
+ }
+#endif
}
}
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltElemPreCompPtr cur, next;
if (style == NULL)
- return;
-
+ return;
+
cur = style->preComps;
while (cur != NULL) {
- next = cur->next;
+ next = cur->next;
if (cur->type == XSLT_FUNC_EXTENSION)
cur->free(cur);
else
*/
void
xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
- /*
+ /*
* The xsltXSLTElemMarker marker was set beforehand by
* the parsing mechanism for all elements in the XSLT namespace.
*/
if (style == NULL) {
- if (node != NULL)
+ if ((node != NULL) && (node->type == XML_ELEMENT_NODE))
node->psvi = NULL;
return;
}
case XSLT_FUNC_APPLYTEMPLATES:
xsltApplyTemplatesComp(style, node);
break;
- case XSLT_FUNC_WITHPARAM:
+ case XSLT_FUNC_WITHPARAM:
xsltWithParamComp(style, node);
break;
- case XSLT_FUNC_VALUEOF:
+ case XSLT_FUNC_VALUEOF:
xsltValueOfComp(style, node);
break;
- case XSLT_FUNC_COPY:
+ case XSLT_FUNC_COPY:
xsltCopyComp(style, node);
break;
case XSLT_FUNC_COPYOF:
xsltCopyOfComp(style, node);
break;
- case XSLT_FUNC_IF:
+ case XSLT_FUNC_IF:
xsltIfComp(style, node);
break;
- case XSLT_FUNC_CHOOSE:
+ case XSLT_FUNC_CHOOSE:
xsltChooseComp(style, node);
break;
- case XSLT_FUNC_WHEN:
+ case XSLT_FUNC_WHEN:
xsltWhenComp(style, node);
break;
- case XSLT_FUNC_OTHERWISE:
+ case XSLT_FUNC_OTHERWISE:
/* NOP yet */
return;
- case XSLT_FUNC_FOREACH:
+ case XSLT_FUNC_FOREACH:
xsltForEachComp(style, node);
break;
- case XSLT_FUNC_APPLYIMPORTS:
+ case XSLT_FUNC_APPLYIMPORTS:
xsltApplyImportsComp(style, node);
break;
- case XSLT_FUNC_ATTRIBUTE:
+ case XSLT_FUNC_ATTRIBUTE:
xsltAttributeComp(style, node);
break;
- case XSLT_FUNC_ELEMENT:
+ case XSLT_FUNC_ELEMENT:
xsltElementComp(style, node);
break;
- case XSLT_FUNC_SORT:
+ case XSLT_FUNC_SORT:
xsltSortComp(style, node);
break;
- case XSLT_FUNC_COMMENT:
+ case XSLT_FUNC_COMMENT:
xsltCommentComp(style, node);
break;
- case XSLT_FUNC_NUMBER:
+ case XSLT_FUNC_NUMBER:
xsltNumberComp(style, node);
break;
- case XSLT_FUNC_PI:
+ case XSLT_FUNC_PI:
xsltProcessingInstructionComp(style, node);
break;
- case XSLT_FUNC_CALLTEMPLATE:
+ case XSLT_FUNC_CALLTEMPLATE:
xsltCallTemplateComp(style, node);
break;
- case XSLT_FUNC_PARAM:
+ case XSLT_FUNC_PARAM:
xsltParamComp(style, node);
break;
- case XSLT_FUNC_VARIABLE:
+ case XSLT_FUNC_VARIABLE:
xsltVariableComp(style, node);
break;
- case XSLT_FUNC_FALLBACK:
+ case XSLT_FUNC_FALLBACK:
/* NOP yet */
return;
- case XSLT_FUNC_DOCUMENT:
+ case XSLT_FUNC_DOCUMENT:
/* The extra one */
node->psvi = (void *) xsltDocumentComp(style, node,
(xsltTransformFunction) xsltDocumentElem);
} else {
/*
* Fallback to string comparison.
- */
+ */
if (IS_XSLT_NAME(node, "apply-templates")) {
xsltApplyTemplatesComp(style, node);
} else if (IS_XSLT_NAME(node, "with-param")) {
} else if (IS_XSLT_NAME(node, "choose")) {
xsltChooseComp(style, node);
} else if (IS_XSLT_NAME(node, "when")) {
- xsltWhenComp(style, node);
+ xsltWhenComp(style, node);
} else if (IS_XSLT_NAME(node, "otherwise")) {
/* NOP yet */
return;
} else if (IS_XSLT_NAME(node, "document")) {
/* The extra one */
node->psvi = (void *) xsltDocumentComp(style, node,
- (xsltTransformFunction) xsltDocumentElem);
+ (xsltTransformFunction) xsltDocumentElem);
} else if (IS_XSLT_NAME(node, "output")) {
/* Top-level */
return;
return;
} else if (IS_XSLT_NAME(node, "strip-space")) {
/* Top-level */
- return;
+ return;
} else if (IS_XSLT_NAME(node, "key")) {
/* Top-level */
return;
/* Top-level */
return;
} else if (IS_XSLT_NAME(node, "include")) {
- /* Top-level */
+ /* Top-level */
} else {
/*
* NOTE that xsl:text, xsl:template, xsl:stylesheet,
"the XSLT element '%s'.\n", node->name);
style->errors++;
return;
- }
+ }
}
/*
* Assign the current list of in-scope namespaces to the
* namespace- and local-name of the node, but can evaluate this
* using cctxt->style->inode->category;
*/
- if (inst->psvi != NULL)
+ if ((inst == NULL) || (inst->type != XML_ELEMENT_NODE) ||
+ (inst->psvi != NULL))
return;
if (IS_XSLT_ELEM(inst)) {
} else if (IS_XSLT_NAME(inst, "attribute")) {
xmlNodePtr parent = inst->parent;
- if ((parent == NULL) || (parent->ns == NULL) ||
+ if ((parent == NULL) ||
+ (parent->type != XML_ELEMENT_NODE) || (parent->ns == NULL) ||
((parent->ns != inst->ns) &&
(!xmlStrEqual(parent->ns->href, inst->ns->href))) ||
(!xmlStrEqual(parent->name, BAD_CAST "attribute-set"))) {
} else if (IS_XSLT_NAME(inst, "call-template")) {
xsltCheckInstructionElement(style, inst);
xsltCallTemplateComp(style, inst);
- } else if (IS_XSLT_NAME(inst, "param")) {
+ } else if (IS_XSLT_NAME(inst, "param")) {
if (xsltCheckTopLevelElement(style, inst, 0) == 0)
xsltCheckInstructionElement(style, inst);
xsltParamComp(style, inst);
xsltCheckInstructionElement(style, inst);
inst->psvi = (void *) xsltDocumentComp(style, inst,
(xsltTransformFunction) xsltDocumentElem);
- } else {
+ } else if ((style == NULL) || (style->forwards_compatible == 0)) {
xsltTransformError(NULL, style, inst,
"xsltStylePreCompute: unknown xsl:%s\n", inst->name);
if (style != NULL) style->warnings++;
}
-
+
cur = (xsltStylePreCompPtr) inst->psvi;
/*
* A ns-list is build for every XSLT item in the