Given the following template:

 <xsl:template match="/">
    <xsl:param name="fred">
      <xsl:variable name="anything" select="'WRONG'"/>
    </xsl:param>
    <xsl:param name="frank" select="'anywho'"/>

    frank: <xsl:value-of select="$frank"/>

  </xsl:template>

What should the value of $frank be? When I run this, I get 'WRONG'. If I remove the variable declaration inside the param "fred", I get 'anywho'. Is this not legal XSLT, or a bug?

Here is the command line:

java org.apache.xalan.xslt.Process -IN test.xml -XSL test.xsl -OUT test.out

Also:
> java org.apache.xalan.xslt.EnvironmentCheck | grep version.xalan
version.xalan2_2=Xalan Java 2.6.0

Thanks,
Alex

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                version="1.0">

  <xsl:template match="/">
    <xsl:param name="fred">
      <xsl:variable name="anything" select="'WRONG'"/>
    </xsl:param>
    <xsl:param name="frank" select="'anywho'"/>

    frank: <xsl:value-of select="$frank"/>

  </xsl:template>

</xsl:stylesheet>
<?xml version="1.0"?>
<test>
  <node>value_one</node>
  <node>value_two</node>
</test>
<?xml version="1.0" encoding="UTF-8"?>

    frank: WRONG

Reply via email to