Hi Patric
On Wed, 24 Sep 2003 17:15:30 +0200 (MEST), Patrick TJ McPhee wrote:
> <xsl:template match="chapter[@id=$chapter_id]">
> This should work. Could you post a complete, but minimal, example
> (data and stylesheet)?
Here the xml:
<book>
<chapter id="1" label="1">
</chapter>
</book>
And the xsl:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns

sl="http://www.w3.org/1999/XSL/Transform">
<xsl

utput method="html" indent="yes" encoding="ISO-8859-1" />
<xsl:variable name="chapter_id">1</xsl:variable>
<xsl:template match="chapter[@id=$chapter_id]">
<xsl:value-of select="@label"/>
</xsl:template>
</xsl:stylesheet>
Tested on WinXP:
Tested with Sablotron (in php4.3.3).
Errror: match pattern contains a variable reference Code: 23
And Saxon 6.5.3:
Error at xsl:template on line 5 of file:/c:/temp/vartest.xsl:
The match pattern in xsl:template may not contain references to variables
Transformation failed: Failed to compile stylesheet. 1 error detected.
Same with <xsl:template match="chapter[@id='1']"> Works fine in both.
Any idea?
Thanks
Nagi