GNOME Bugzilla – Bug 778435
While forwards-compatible processing libxslt does not ignore unknown element's content
Last modified: 2017-02-10 12:33:45 UTC
Test stylesheet: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:function name="foo"> <xsl:param name="bar"/> <xsl:sequence select="''"/> </xsl:function> <xsl:template match="/"> <p>it works!</p> </xsl:template> </xsl:stylesheet> Expected output using xsltproc: <?xml version="1.0"?> <p>it works</p> Actual output using xsltproc: ... compilation error: file /tmp/test.xsl line 5 element param element param only allowed within a template, variable or param ... transform aborts The spec is very clear: "If an element is processed in forwards-compatible mode, then: if it is a top-level element and XSLT 1.0 does not allow such elements as top-level elements, then the element must be ignored along with its content;" -- https://www.w3.org/TR/xslt#forwards
This issue has already been fixed with the following commit: https://git.gnome.org/browse/libxslt/commit/?id=af31ef183b0c7032ac312c8217f62e3fa5425250 The fix will be part of the next release. *** This bug has been marked as a duplicate of bug 677901 ***