[xslt] xsl:variable scope problem with 0.10 ?



Applying the first stylesheet below against any document will fail with the
following output from xsltProc.

unregistered variable var
unregistered variable var
xmlXPathEval: evaluation failed
xsltDefaultProcessOneNode: text copy failed


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:variable name="var" select="string('mark')"/>
<xsl:value-of select="$var"/>
</xsl:template>
</xsl:stylesheet> 

The following works without problems.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="var" select="string('mark')"/>
<xsl:template match="/">
<xsl:value-of select="$var"/>
</xsl:template>
</xsl:stylesheet> 

This seems to be a problem with 0.10 but worked with prior releases.  I have
tried to trace through the code to isolate the problem, but am struggling
with the learning curve of the libxslt internals.

Does anyone have any ideas?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]