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 303289 - variable reference in "match" isn't reported
variable reference in "match" isn't reported
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-05-06 18:50 UTC by Oleg Paraschenko
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Oleg Paraschenko 2005-05-06 18:50:37 UTC
According to the XSLT Recommendation, Section 5.3 "Defining Template Rules",

[quote]It is an error for the value of the "match" attribute to contain a
"VariableReference".[/quote]

Here is the sample XLST which incorrectly uses a variable:

[code]
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- -->

<xsl:variable name="a" select="2"/>

<xsl:template match="/*[$a=2]">
  <out/>
</xsl:template>

</xsl:stylesheet>
[/code]

Executed with xsltproc, the stylesheet produces the following result:

[screen]
<?xml version="1.0"?>
<out/>
[/screen]

But instead of running XSLT, xsltproc should report the error, something like it:

Error at xsl:template on line 6 of file:<filename>:
  The match pattern in xsl:template may not contain references to variables
Comment 1 Daniel Veillard 2005-09-04 22:09:58 UTC
Found and fixed, it will hit CVS soon, though it needs both a libxml2-2.6.21 and
an libxslt update.

Daniel
Comment 2 Daniel Veillard 2005-09-05 08:59:39 UTC
This should be closed by release of libxml2-2.6.21,

  thanks,

Daniel
Comment 3 Oleg Paraschenko 2005-09-05 20:15:43 UTC
Yes, now xsltproc correctly reports an error.