GNOME Bugzilla – Bug 124286
xsl:template name="...": Invalid QNames possible?
Last modified: 2009-08-15 18:40: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
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 $
This should be fixed in libxslt-1.1.0, thanks, Daniel