[no subject]

For any use of these variable-binding elements, there is a region of the
stylesheet tree within which the binding is visible; within this region,
any binding of the variable that was visible on the variable-binding
element itself is hidden. Thus, only the innermost binding of a variable is
visible. The set of variable bindings in scope for an expression consists
of those bindings that are visible at the point in the stylesheet where the
expression occurs.

So saxon9he seems to assue the second definition of v as innermost binding,
while xsltproc seems to see both on the same binding level.
What is the spec conforming behavior?

$ xsltproc -version
Using libxml 20626, libxslt 10117 and libexslt 813
xsltproc was compiled against libxml 20626, libxslt 10117 and libexslt 813
libxslt 10117 was compiled against libxml 20626
libexslt 813 was compiled against libxml 20626
$ xsltproc m.xsl m.xsl
runtime error: file m.xsl line 8 element variable
xsl:variable : redefining v
no result for m.xsl
$ java -jar saxon9he.jar -xmlversion:1.0 -xsl:m.xsl -s:m.xsl
-versionmsg:off ; echo
<?xml version="1.0" encoding="UTF-8"?>12
$
$ cat m.xsl
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>
  <xsl:template match="/">

    <xsl:variable name="v" select="1"/>
    <xsl:value-of select="$v"/>
    <xsl:variable name="v" select="2"/>
    <xsl:value-of select="$v"/>

  </xsl:template>
</xsl:stylesheet>
$


Mit besten Gruessen / Best wishes,

Hermann Stamm-Wilbrandt
Developer, XML Compiler, L3
WebSphere DataPower SOA Appliances
----------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

Current Thread