After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778435 - While forwards-compatible processing libxslt does not ignore unknown element's content
While forwards-compatible processing libxslt does not ignore unknown element'...
Status: RESOLVED DUPLICATE of bug 677901
Product: libxslt
Classification: Platform
Component: general
1.1.29
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-10 09:43 UTC by Marcello Perathoner
Modified: 2017-02-10 12:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marcello Perathoner 2017-02-10 09:43:24 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
Comment 1 Nick Wellnhofer 2017-02-10 12:33:45 UTC
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 ***