ret->extrasNr = 0;
ret->internalized = 1;
ret->literal_result = 0;
+ ret->forwards_compatible = 0;
ret->dict = xmlDictCreate();
#ifdef WITH_XSLT_DEBUG
xsltGenericDebug(xsltGenericDebugContext,
(!xmlStrEqual(prop, (const xmlChar *)"1.1"))) {
xsltTransformError(NULL, style, top,
"xsl:version: only 1.0 features are supported\n");
- /* TODO set up compatibility when not XSLT 1.0 */
- if (style != NULL) style->warnings++;
+ if (style != NULL) {
+ style->forwards_compatible = 1;
+ style->warnings++;
+ }
}
xmlFree(prop);
}
} else if (IS_XSLT_NAME(cur, "namespace-alias")) {
xsltNamespaceAlias(style, cur);
} else {
- /*
- * BUG TODO: The version of the *doc* is irrelevant for
- * the forwards-compatible mode.
- */
- if ((style != NULL) && (style->doc->version != NULL) &&
- (!strncmp((const char *) style->doc->version, "1.0", 3))) {
+ if ((style != NULL) && (style->forwards_compatible == 0)) {
xsltTransformError(NULL, style, cur,
"xsltParseStylesheetTop: unknown %s element\n",
cur->name);
xsltPrincipalStylesheetDataPtr principalData;
#endif
+ /*
+ * Forwards-compatible processing
+ */
+ int forwards_compatible;
};
typedef struct _xsltTransformCache xsltTransformCache;
--- /dev/null
+compilation error: file ./bug-175.xsl line 28 element function
+xsltStylePreCompute: unknown xsl:function
+compilation error: file ./bug-175.xsl line 5 element transform
+xsl:version: only 1.0 features are supported
+compilation error: file ./bug-175.xsl line 28 element function
+xsltParseStylesheetTop: ignoring unknown function element
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>xsl:function</title>
+</head>
+<body><p><tt>xsl:function</tt> not supported, but properly handled (ignored)</p></body>
+</html>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:test="#test"
+ exclude-result-prefixes="test"
+ version="2.0">
+ <xsl:output method="html" encoding="iso-8859-1" version="4.0"
+ doctype-public="-//W3C//DTD HTML 4.01//EN"
+ indent="yes"/>
+
+ <xsl:template match="/">
+ <html>
+ <head>
+ <title>xsl:function</title>
+ </head>
+ <body>
+ <xsl:choose>
+ <xsl:when test="function-available('test:test')">
+ <p>Result: <xsl:value-of select="test:test()"/></p>
+ </xsl:when>
+ <xsl:otherwise>
+ <p><tt>xsl:function</tt> not supported, but properly handled (ignored)</p>
+ </xsl:otherwise>
+ </xsl:choose>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:function name="test:test">YES</xsl:function>
+
+</xsl:transform>