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 677901 - xslt forwards compatible mode does not work
xslt forwards compatible mode does not work
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
: 778435 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-06-11 21:30 UTC by Julian Reschke
Modified: 2017-02-10 12:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Julian Reschke 2012-06-11 21:30:00 UTC
The stylesheet below:


<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:test="#tes
t"
               xmlns:tc="mailto:julian.reschke@greenbytes.de?subject=xslt"
               version="2.0">
   <xsl:output method="html" encoding="iso-8859-1" version="4.0"
               doctype-public="-//W3C//DTD HTML 4.01//EN"
               indent="no"/>

   <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>

should either result in "YES", or in "xsl:function not supported, but properly handled (ignored)". Instead, it aborts with:

compilation error: file ... line 30 element function


(see also http://greenbytes.de/tech/tc/xslt/#ft-xsl-function and http://www.w3.org/TR/xslt#forwards)
Comment 2 Daniel Veillard 2012-08-16 08:23:37 UTC
Looks good, I just made a couple of small tweaks and pushed
upstream,

http://git.gnome.org/browse/libxslt/commit/?id=faeaa3146cab124628785c4b536ba0b824292f8d

  thanks a lot !

Daniel
Comment 3 François 2016-07-02 20:42:25 UTC
Hello,

this fix from 2012 is not complete: libxslt doesn't ignore element content:

  <xsl:function name="test:test">
     <xsl:param name="x"/>
     <xsl:sequence select="$x"/>
  </xsl:function>

will fail ("element param only allowed within a template, variable or param").

Additionaly it would be nice if it would not emit a message for every unknown element: I think saying "xsl:version: only 1.0 features are supported" is enough... (and for that last message, it doesn't print in case version="1.1")

François
Comment 5 François 2016-07-12 21:20:34 UTC
Thanks, and felicitation for fixing so fast!
Comment 6 Nick Wellnhofer 2017-02-10 12:33:45 UTC
*** Bug 778435 has been marked as a duplicate of this bug. ***