GNOME Bugzilla – Bug 303289
variable reference in "match" isn't reported
Last modified: 2009-08-15 18:40:50 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
Found and fixed, it will hit CVS soon, though it needs both a libxml2-2.6.21 and an libxslt update. Daniel
This should be closed by release of libxml2-2.6.21, thanks, Daniel
Yes, now xsltproc correctly reports an error.