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 124286 - xsl:template name="...": Invalid QNames possible?
xsl:template name="...": Invalid QNames possible?
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other other
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2003-10-10 10:04 UTC by Thomas Schraitle
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Schraitle 2003-10-10 10:04:50 UTC
Hi, 
 
consider a named template like this: 
 
<xsl:template name="something"> 
... 
</xsl:template> 
 
This is ok. According to [1] the attribute name must be a QName. So this should not 
work: 
 
<xsl:template name="bad()"> 
... 
</xsl:template> 
 
Unfortunatly xsltproc gives no message. I noticed this when I copied and pasted a 
rule and forgot to adjust the attribute, like <xsl:template name="title/text()">. IMHO 
this is a bad situation. I would find it better to give at least a message or any 
appropriate hint. By the way, Saxon prints an error message and cancels. :) 
 
Hopefully my understanding of the specs are correct. :) 
 
Thanks for reading. 
 
Bye, 
Tom 
 
I tried this with the current CVS version of libxml2 and libxslt. 
 
------ 
[1] http://www.w3.org/TR/xslt#section-Defining-Template-Rules
Comment 1 William M. Brack 2003-11-02 17:49:52 UTC
You are certainly correct - thanks for report.  Fixed in CVS:
bill@bbrack qname $ cat bb.xsl
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.1" >
        <xsl:output method="text" encoding="utf-8"/>

        <xsl:template name="bad()" match="text()">
                        <xsl:value-of select="."/>
        </xsl:template>

</xsl:stylesheet>
bill@bbrack qname $ ./xsltproc bb.xsl bb.xsl
compilation error: file bb.xsl line 6 element template
xsl:template : error invalid name 'bad()'
bill@bbrack qname $
Comment 2 Daniel Veillard 2003-11-05 23:51:16 UTC
This should be fixed in libxslt-1.1.0,

 thanks,

Daniel