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 409047 - variable name with leading/trailing spaces causes problems
variable name with leading/trailing spaces causes problems
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
1.1.17
Other Windows
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2007-02-17 20:05 UTC by J.Pietschmann
Modified: 2007-02-18 00:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description J.Pietschmann 2007-02-17 20:05:54 UTC
The xsltproc included in the current Cygwin distribution barfs on a style sheet
with the following template:
  <xsl:template match="/">
    <xsl:variable name=" foo ">foo</xsl:variable>
    <xsl:value-of select="$foo"/>
  </xsl:template>
...
xsltproc test.xsl test.xsl
runtime error: file test.xsl line 7 element value-of
unregistered variable foo
xmlXPathCompiledEval: evaluation failed
...
xsltproc -V
Using libxml 20626, libxslt 10117-CVS1062 and libexslt 813-CVS1062
xsltproc was compiled against libxml 20626, libxslt 10117 and libexslt 813

Saxon 6.5.3 complains already about the variable definition:
Error at xsl:variable on line 6 of file:/<snip>/test.xsl:
  Variable name must be a valid QName

which ought to be correct according to the XSLT 1.0 Rec (section 11: "The
value of the name attribute is a QName").

The problem originally arose with the iso-schematron.xsl style sheet, which
claims to be checked against Saxon 8, which supports XSLT 2.0. I have not
made the effort to check whether spaces around variable names in variable
definitions are legal in XSLT 2.0, nor whether Saxon 8 indeed runs the file.

Conclusion: Either add a check that the value of the name attribute of a
variable definition is indeed a QName, or trim the spaces, whatever the
supported XSLT rec says.
Comment 1 William M. Brack 2007-02-18 00:11:04 UTC
This problem has already been fixed in the current release - 1.1.20