xsltStylePreCompPtr comp;
const xmlChar *filename = NULL;
+ /*
+ * As of 2006-03-30, this function is currently defined in Libxslt
+ * to be used for:
+ * (in libxslt/extra.c)
+ * "output" in XSLT_SAXON_NAMESPACE
+ * "write" XSLT_XALAN_NAMESPACE
+ * "document" XSLT_XT_NAMESPACE
+ * "document" XSLT_NAMESPACE
+ * (in libexslt/common.c)
+ * "document" in EXSLT_COMMON_NAMESPACE
+ */
comp = xsltNewStylePreComp(style, XSLT_FUNC_DOCUMENT);
if (comp == NULL)
return (NULL);
xsltGenericDebug(xsltGenericDebugContext,
"Found saxon:output extension\n");
#endif
+ /*
+ * The element "output" is in the namespace XSLT_SAXON_NAMESPACE
+ * (http://icl.com/saxon)
+ * The @file is in no namespace.
+ */
filename = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"file",
- XSLT_SAXON_NAMESPACE, &comp->has_filename);
+ NULL, &comp->has_filename);
} else if (xmlStrEqual(inst->name, (const xmlChar *) "write")) {
#ifdef WITH_XSLT_DEBUG_EXTRA
xsltGenericDebug(xsltGenericDebugContext,
"Found xalan:write extension\n");
#endif
- comp->ver11 = 0; /* the filename need to be interpreted */
+ /* the filename need to be interpreted */
+ /*
+ * TODO: Is "filename need to be interpreted" meant to be a todo?
+ * Where will be the filename of xalan:write be processed?
+ */
} else if (xmlStrEqual(inst->name, (const xmlChar *) "document")) {
- filename = xsltEvalStaticAttrValueTemplate(style, inst,
- (const xmlChar *)"href",
- XSLT_XT_NAMESPACE, &comp->has_filename);
- if (comp->has_filename == 0) {
+ if (inst->ns != NULL) {
+ if (xmlStrEqual(inst->ns->href, XSLT_NAMESPACE)) {
+ /* Mark the instruction as being of XSLT version 1.1. */
+ comp->ver11 = 1;
#ifdef WITH_XSLT_DEBUG_EXTRA
- xsltGenericDebug(xsltGenericDebugContext,
- "Found xslt11:document construct\n");
+ xsltGenericDebug(xsltGenericDebugContext,
+ "Found xslt11:document construct\n");
+#endif
+ } else {
+ if (xmlStrEqual(inst->ns->href,
+ (const xmlChar *)"http://exslt.org/common")) {
+ /* EXSLT. */
+#ifdef WITH_XSLT_DEBUG_EXTRA
+ xsltGenericDebug(xsltGenericDebugContext,
+ "Found exslt:document extension\n");
#endif
- filename = xsltEvalStaticAttrValueTemplate(style, inst,
- (const xmlChar *)"href",
- XSLT_NAMESPACE, &comp->has_filename);
- comp->ver11 = 1;
- } else {
+ } else if (xmlStrEqual(inst->ns->href, XSLT_XT_NAMESPACE)) {
+ /* James Clark's XT. */
#ifdef WITH_XSLT_DEBUG_EXTRA
- xsltGenericDebug(xsltGenericDebugContext,
- "Found xt:document extension\n");
+ xsltGenericDebug(xsltGenericDebugContext,
+ "Found xt:document extension\n");
#endif
- comp->ver11 = 0;
+ }
+ }
}
- }
+ /*
+ * The element "document" is used in conjunction with the
+ * following namespaces:
+ * 1) XSLT_NAMESPACE (http://www.w3.org/1999/XSL/Transform version 1.1)
+ * <!ELEMENT xsl:document %template;>
+ * <!ATTLIST xsl:document
+ * href %avt; #REQUIRED
+ * 2) EXSLT_COMMON_NAMESPACE (http://exslt.org/common)
+ * <exsl:document
+ * href = { uri-reference }
+ * 3) XSLT_XT_NAMESPACE (http://www.jclark.com/xt)
+ * Example: <xt:document method="xml" href="myFile.xml">
+ *
+ * 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;
}
if ((style == NULL) || (inst == NULL))
return;
+ /*
+ * <xsl:sort
+ * select = string-expression
+ * lang = { nmtoken }
+ * data-type = { "text" | "number" | qname-but-not-ncname }
+ * order = { "ascending" | "descending" }
+ * case-order = { "upper-first" | "lower-first" } />
+ */
comp = xsltNewStylePreComp(style, XSLT_FUNC_SORT);
if (comp == NULL)
return;
comp->stype = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"data-type",
- XSLT_NAMESPACE, &comp->has_stype);
+ NULL, &comp->has_stype);
if (comp->stype != NULL) {
if (xmlStrEqual(comp->stype, (const xmlChar *) "text"))
comp->number = 0;
}
comp->order = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"order",
- XSLT_NAMESPACE, &comp->has_order);
+ NULL, &comp->has_order);
if (comp->order != NULL) {
if (xmlStrEqual(comp->order, (const xmlChar *) "ascending"))
comp->descending = 0;
}
comp->case_order = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"case-order",
- XSLT_NAMESPACE, &comp->has_use);
+ NULL, &comp->has_use);
if (comp->case_order != NULL) {
if (xmlStrEqual(comp->case_order, (const xmlChar *) "upper-first"))
comp->lower_first = 0;
comp->lang = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"lang",
- XSLT_NAMESPACE, &comp->has_lang);
+ NULL, &comp->has_lang);
comp->select = xsltGetCNsProp(style, inst,(const xmlChar *)"select", XSLT_NAMESPACE);
if (comp->select == NULL) {
xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
xsltStylePreCompPtr comp;
+ /*
+ * <xsl:element
+ * name = { qname }
+ * namespace = { uri-reference }
+ * use-attribute-sets = qnames>
+ * <!-- Content: template -->
+ * </xsl:element>
+ */
if ((style == NULL) || (inst == NULL))
return;
comp = xsltNewStylePreComp(style, XSLT_FUNC_ELEMENT);
comp->name = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"name",
- XSLT_NAMESPACE, &comp->has_name);
+ NULL, &comp->has_name);
if (comp->name != NULL) {
if (xmlValidateQName(comp->name, 0)) {
xsltTransformError(NULL, style, inst,
}
comp->ns = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"namespace",
- XSLT_NAMESPACE, &comp->has_ns);
+ NULL, &comp->has_ns);
if (comp->has_ns == 0) {
xmlNsPtr defaultNs;
}
comp->use = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"use-attribute-sets",
- XSLT_NAMESPACE, &comp->has_use);
+ NULL, &comp->has_use);
}
/**
xsltAttributeComp(xsltStylesheetPtr style, xmlNodePtr inst) {
xsltStylePreCompPtr comp;
+ /*
+ * <xsl:attribute
+ * name = { qname }
+ * namespace = { uri-reference }>
+ * <!-- Content: template -->
+ * </xsl:attribute>
+ */
if ((style == NULL) || (inst == NULL))
return;
comp = xsltNewStylePreComp(style, XSLT_FUNC_ATTRIBUTE);
*/
comp->name = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"name",
- XSLT_NAMESPACE, &comp->has_name);
+ NULL, &comp->has_name);
if (comp->name != NULL) {
if (xmlValidateQName(comp->name, 0)) {
xsltTransformError(NULL, style, inst,
}
comp->ns = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"namespace",
- XSLT_NAMESPACE, &comp->has_ns);
+ NULL, &comp->has_ns);
}
int maxns = 10;
int i;
+ /*
+ * TODO: This will gather the ns-decls of elements even if
+ * outside xsl:stylesheet. Example:
+ * <doc xmlns:foo="urn:test:foo">
+ * <xsl:stylesheet ...
+ * </doc>
+ * Will have foo="urn:test:foo" in the list.
+ * Is this a bug?
+ */
+
if ((style == NULL) || (template == NULL) || (node == NULL) ||
(template->inheritedNsNr != 0) || (template->inheritedNs != NULL))
return(0);
if ((cur->prefix != NULL) &&
(xsltCheckExtPrefix(style, cur->prefix)))
goto skip_ns;
+ /*
+ * Check if this namespace was excluded.
+ * Note that at this point only the exclusions defined
+ * on the topmost stylesheet element are in the exclusion-list.
+ */
for (i = 0;i < style->exclPrefixNr;i++) {
if (xmlStrEqual(cur->href, style->exclPrefixTab[i]))
goto skip_ns;
}
ret[nbns] = NULL;
}
+ /*
+ * Skip shadowed namespace bindings.
+ */
for (i = 0; i < nbns; i++) {
if ((cur->prefix == ret[i]->prefix) ||
(xmlStrEqual(cur->prefix, ret[i]->prefix)))
if ((cur == NULL) || (style == NULL))
return;
-
- prop = xsltGetNsProp(cur, (const xmlChar *) "version", XSLT_NAMESPACE);
+
+ prop = xmlGetNsProp(cur, (const xmlChar *) "version", NULL);
if (prop != NULL) {
if (style->version != NULL)
xmlFree(style->version);
style->version = prop;
}
- prop =
- xsltGetNsProp(cur, (const xmlChar *) "encoding", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *) "encoding", NULL);
if (prop != NULL) {
if (style->encoding != NULL)
xmlFree(style->encoding);
style->encoding = prop;
}
- /* relaxed to support xt:document */
- prop = xmlGetProp(cur, (const xmlChar *) "method");
+ /* relaxed to support xt:document
+ * TODO KB: What does "relaxed to support xt:document" mean?
+ */
+ prop = xmlGetNsProp(cur, (const xmlChar *) "method", NULL);
if (prop != NULL) {
const xmlChar *URI;
}
}
- prop =
- xsltGetNsProp(cur, (const xmlChar *) "doctype-system",
- XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *) "doctype-system", NULL);
if (prop != NULL) {
if (style->doctypeSystem != NULL)
xmlFree(style->doctypeSystem);
style->doctypeSystem = prop;
}
- prop =
- xsltGetNsProp(cur, (const xmlChar *) "doctype-public",
- XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *) "doctype-public", NULL);
if (prop != NULL) {
if (style->doctypePublic != NULL)
xmlFree(style->doctypePublic);
style->doctypePublic = prop;
}
- prop = xsltGetNsProp(cur, (const xmlChar *) "standalone",
- XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *) "standalone", NULL);
if (prop != NULL) {
if (xmlStrEqual(prop, (const xmlChar *) "yes")) {
style->standalone = 1;
xmlFree(prop);
}
- prop = xsltGetNsProp(cur, (const xmlChar *) "indent", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *) "indent", NULL);
if (prop != NULL) {
if (xmlStrEqual(prop, (const xmlChar *) "yes")) {
style->indent = 1;
xmlFree(prop);
}
- prop = xsltGetNsProp(cur, (const xmlChar *) "omit-xml-declaration",
- XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *) "omit-xml-declaration", NULL);
if (prop != NULL) {
if (xmlStrEqual(prop, (const xmlChar *) "yes")) {
style->omitXmlDeclaration = 1;
xmlFree(prop);
}
- elements =
- xsltGetNsProp(cur, (const xmlChar *) "cdata-section-elements",
- XSLT_NAMESPACE);
+ elements = xmlGetNsProp(cur, (const xmlChar *) "cdata-section-elements",
+ NULL);
if (elements != NULL) {
if (style->cdataSection == NULL)
style->cdataSection = xmlHashCreate(10);
xmlFree(elements);
}
- prop = xsltGetNsProp(cur, (const xmlChar *) "media-type", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *) "media-type", NULL);
if (prop != NULL) {
if (style->mediaType)
xmlFree(style->mediaType);
format = style->decimalFormat;
- prop = xsltGetNsProp(cur, BAD_CAST("name"), XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, BAD_CAST("name"), NULL);
if (prop != NULL) {
format = xsltDecimalFormatGetByName(style, prop);
if (format != NULL) {
iter->next = format;
}
- prop = xsltGetNsProp(cur, (const xmlChar *)"decimal-separator",
- XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *)"decimal-separator", NULL);
if (prop != NULL) {
if (format->decimalPoint != NULL) xmlFree(format->decimalPoint);
format->decimalPoint = prop;
}
- prop = xsltGetNsProp(cur, (const xmlChar *)"grouping-separator",
- XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *)"grouping-separator", NULL);
if (prop != NULL) {
if (format->grouping != NULL) xmlFree(format->grouping);
format->grouping = prop;
}
- prop = xsltGetNsProp(cur, (const xmlChar *)"infinity", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *)"infinity", NULL);
if (prop != NULL) {
if (format->infinity != NULL) xmlFree(format->infinity);
format->infinity = prop;
}
- prop = xsltGetNsProp(cur, (const xmlChar *)"minus-sign", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *)"minus-sign", NULL);
if (prop != NULL) {
if (format->minusSign != NULL) xmlFree(format->minusSign);
format->minusSign = prop;
}
- prop = xsltGetNsProp(cur, (const xmlChar *)"NaN", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *)"NaN", NULL);
if (prop != NULL) {
if (format->noNumber != NULL) xmlFree(format->noNumber);
format->noNumber = prop;
}
- prop = xsltGetNsProp(cur, (const xmlChar *)"percent", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *)"percent", NULL);
if (prop != NULL) {
if (format->percent != NULL) xmlFree(format->percent);
format->percent = prop;
}
- prop = xsltGetNsProp(cur, (const xmlChar *)"per-mille", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *)"per-mille", NULL);
if (prop != NULL) {
if (format->permille != NULL) xmlFree(format->permille);
format->permille = prop;
}
- prop = xsltGetNsProp(cur, (const xmlChar *)"zero-digit", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *)"zero-digit", NULL);
if (prop != NULL) {
if (format->zeroDigit != NULL) xmlFree(format->zeroDigit);
format->zeroDigit = prop;
}
- prop = xsltGetNsProp(cur, (const xmlChar *)"digit", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *)"digit", NULL);
if (prop != NULL) {
if (format->digit != NULL) xmlFree(format->digit);
format->digit = prop;
}
- prop = xsltGetNsProp(cur, (const xmlChar *)"pattern-separator",
- XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *)"pattern-separator", NULL);
if (prop != NULL) {
if (format->patternSeparator != NULL) xmlFree(format->patternSeparator);
format->patternSeparator = prop;
if ((cur == NULL) || (style == NULL))
return;
- elements = xsltGetNsProp(cur, (const xmlChar *)"elements", XSLT_NAMESPACE);
+ elements = xmlGetNsProp(cur, (const xmlChar *)"elements", NULL);
if (elements == NULL) {
xsltTransformError(NULL, style, cur,
"xsltParseStylesheetPreserveSpace: missing elements attribute\n");
* @style: the XSLT stylesheet
* @template: the "extension-element-prefixes" prefix
*
- * parse an XSLT stylesheet extension prefix and record
- * prefixes needing stripping
+ * parse an XSLT stylesheet's "extension-element-prefix" attribute value
+ * and register the namespaces of extension elements.
+ * SPEC "A namespace is designated as an extension namespace by using
+ * an extension-element-prefixes attribute on:
+ * 1) an xsl:stylesheet element
+ * 2) TODO: an xsl:extension-element-prefixes attribute on a
+ * literal result element
+ * 3) TODO: an extension element."
*/
static void
-xsltParseStylesheetExtPrefix(xsltStylesheetPtr style, xmlNodePtr cur) {
+xsltParseStylesheetExtPrefix(xsltStylesheetPtr style, xmlNodePtr cur,
+ int isXsltElem) {
xmlChar *prefixes;
xmlChar *prefix, *end;
if ((cur == NULL) || (style == NULL))
return;
- prefixes = xsltGetNsProp(cur, (const xmlChar *)"extension-element-prefixes",
- XSLT_NAMESPACE);
+ if (isXsltElem) {
+ /* For xsl:stylesheet/xsl:transform. */
+ prefixes = xmlGetNsProp(cur,
+ (const xmlChar *)"extension-element-prefixes", NULL);
+ } else {
+ /* For literal result elements and extension elements. */
+ prefixes = xmlGetNsProp(cur,
+ (const xmlChar *)"extension-element-prefixes", XSLT_NAMESPACE);
+ }
if (prefixes == NULL) {
return;
}
* @style: the XSLT stylesheet
* @cur: the "strip-space" element
*
- * parse an XSLT stylesheet strip-space element and record
- * elements needing stripping
+ * parse an XSLT stylesheet's strip-space element and record
+ * the elements needing stripping
*/
static void
if ((cur == NULL) || (style == NULL))
return;
- elements = xsltGetNsProp(cur, (const xmlChar *)"elements", XSLT_NAMESPACE);
+ elements = xmlGetNsProp(cur, (const xmlChar *)"elements", NULL);
if (elements == NULL) {
xsltTransformError(NULL, style, cur,
"xsltParseStylesheetStripSpace: missing elements attribute\n");
*/
static int
-xsltParseStylesheetExcludePrefix(xsltStylesheetPtr style, xmlNodePtr cur) {
+xsltParseStylesheetExcludePrefix(xsltStylesheetPtr style, xmlNodePtr cur,
+ int isXsltElem)
+{
int nb = 0;
xmlChar *prefixes;
xmlChar *prefix, *end;
if ((cur == NULL) || (style == NULL))
return(0);
- prefixes = xsltGetNsProp(cur, (const xmlChar *)"exclude-result-prefixes",
- XSLT_NAMESPACE);
+ if (isXsltElem)
+ prefixes = xmlGetNsProp(cur,
+ (const xmlChar *)"exclude-result-prefixes", NULL);
+ else
+ prefixes = xmlGetNsProp(cur,
+ (const xmlChar *)"exclude-result-prefixes", XSLT_NAMESPACE);
+
if (prefixes == NULL) {
return(0);
}
}
}
- exclPrefixes = xsltParseStylesheetExcludePrefix(style, cur);
+ /*
+ * SPEC "A namespace URI is designated as an excluded namespace
+ * by using an exclude-result-prefixes attribute on an
+ * xsl:stylesheet element or an xsl:exclude-result-prefixes
+ * attribute on a literal result element."
+ * TODO: The evaluation of "exclude-result-prefixes" is still not
+ * correrct here, since we apply this to extension elements as
+ * well. So either we need to be extension-element-aware here
+ * or move this to an other layer.
+ */
if (IS_XSLT_ELEM(cur)) {
+ exclPrefixes = xsltParseStylesheetExcludePrefix(style, cur, 1);
xsltStylePreCompute(style, cur);
if (IS_XSLT_NAME(cur, "text")) {
for (;exclPrefixes > 0;exclPrefixes--)
exclPrefixPop(style);
goto skip_children;
}
- }
+ } else
+ exclPrefixes = xsltParseStylesheetExcludePrefix(style, cur, 0);
/*
* Remove excluded prefixes
xmlNodePtr text = cur->children, next;
int noesc = 0;
- prop = xsltGetNsProp(cur,
- (const xmlChar *)"disable-output-escaping",
- XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur,
+ (const xmlChar *)"disable-output-escaping",
+ NULL);
if (prop != NULL) {
#ifdef WITH_XSLT_DEBUG_PARSING
xsltGenericDebug(xsltGenericDebugContext,
/*
* Get arguments
*/
- prop = xsltGetNsProp(key, (const xmlChar *)"name", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(key, (const xmlChar *)"name", NULL);
if (prop != NULL) {
const xmlChar *URI;
goto error;
}
- match = xsltGetNsProp(key, (const xmlChar *)"match", XSLT_NAMESPACE);
+ match = xmlGetNsProp(key, (const xmlChar *)"match", NULL);
if (match == NULL) {
xsltTransformError(NULL, style, key,
"xsl:key : error missing match\n");
goto error;
}
- use = xsltGetNsProp(key, (const xmlChar *)"use", XSLT_NAMESPACE);
+ use = xmlGetNsProp(key, (const xmlChar *)"use", NULL);
if (use == NULL) {
xsltTransformError(NULL, style, key,
"xsl:key : error missing use\n");
xmlChar *mode = NULL;
xmlChar *modeURI = NULL;
double priority;
- int exclPrefixes;
if (template == NULL)
return;
ret->next = style->templates;
style->templates = ret;
ret->style = style;
-
- /*
- * Check excluded prefixes
- */
- exclPrefixes = xsltParseStylesheetExcludePrefix(style, template);
-
+
/*
* Get inherited namespaces
*/
/*
* Get arguments
*/
- prop = xsltGetNsProp(template, (const xmlChar *)"mode", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(template, (const xmlChar *)"mode", NULL);
if (prop != NULL) {
const xmlChar *URI;
if (mode != NULL) xmlFree(mode);
if (modeURI != NULL) xmlFree(modeURI);
}
- prop = xsltGetNsProp(template, (const xmlChar *)"match", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(template, (const xmlChar *)"match", NULL);
if (prop != NULL) {
if (ret->match != NULL) xmlFree(ret->match);
ret->match = prop;
}
- prop = xsltGetNsProp(template, (const xmlChar *)"priority", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(template, (const xmlChar *)"priority", NULL);
if (prop != NULL) {
priority = xmlXPathStringEvalNumber(prop);
ret->priority = (float) priority;
xmlFree(prop);
}
- prop = xsltGetNsProp(template, (const xmlChar *)"name", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(template, (const xmlChar *)"name", NULL);
if (prop != NULL) {
const xmlChar *URI;
xsltTemplatePtr cur;
xsltAddTemplate(style, ret, ret->mode, ret->modeURI);
error:
- for (;exclPrefixes > 0;exclPrefixes--)
- exclPrefixPop(style);
+ return;
}
/**
* xsltParseStylesheetTop:
* @style: the XSLT stylesheet
- * @top: the top level "stylesheet" element
+ * @top: the top level "stylesheet" or "transform" element
*
* scan the top level elements of an XSL stylesheet
*/
if (top == NULL)
return;
- prop = xsltGetNsProp(top, (const xmlChar *)"version", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(top, (const xmlChar *)"version", NULL);
if (prop == NULL) {
xsltTransformError(NULL, style, top,
"xsl:version is missing: document may not be a stylesheet\n");
xsltTransformError(NULL, ret, (xmlNodePtr) doc,
"xsltParseStylesheetProcess : empty stylesheet\n");
return(NULL);
- }
- xsltParseStylesheetExcludePrefix(ret, cur);
+ }
if ((IS_XSLT_ELEM(cur)) &&
((IS_XSLT_NAME(cur, "stylesheet")) ||
- (IS_XSLT_NAME(cur, "transform")))) {
+ (IS_XSLT_NAME(cur, "transform")))) {
#ifdef WITH_XSLT_DEBUG_PARSING
xsltGenericDebug(xsltGenericDebugContext,
"xsltParseStylesheetProcess : found stylesheet\n");
#endif
ret->literal_result = 0;
-
- xsltParseStylesheetExtPrefix(ret, cur);
+ xsltParseStylesheetExcludePrefix(ret, cur, 1);
+ xsltParseStylesheetExtPrefix(ret, cur, 1);
} else {
+ xsltParseStylesheetExcludePrefix(ret, cur, 0);
+ xsltParseStylesheetExtPrefix(ret, cur, 0);
ret->literal_result = 1;
}
if (!ret->nopreproc)
/*
* the document itself might be the template, check xsl:version
*/
- prop = xsltGetNsProp(cur, (const xmlChar *)"version", XSLT_NAMESPACE);
+ prop = xmlGetNsProp(cur, (const xmlChar *)"version", XSLT_NAMESPACE);
if (prop == NULL) {
xsltTransformError(NULL, ret, cur,
"xsltParseStylesheetProcess : document is not a stylesheet\n");