You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Otto Chrons <ot...@vvf.fi> on 2000/06/01 18:50:34 UTC

Template parameter passing bug in Xalan-C 0.30.0

Hi,

I encountered a disparency between Xalan-J 1.0.1 and Xalan-C 0.30.0 with the way they do parameter passing. Here's a simplified example:

<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
   <xsl:template name="DoIt">
      <xsl:param name="param1">My Default Value.</xsl:param>
      <xsl:value-of select="$param1"/>
   </xsl:template>

   <xsl:template match="/">
   <out>
      <xsl:call-template name="DoIt">
         <xsl:with-param name="param1">Hoo Haa !</xsl:with-param>
      </xsl:call-template>
   </out>
   </xsl:template>
</xsl:stylesheet>

(XML file)
<?xml version="1.0"?>
<doc>Hello</doc>


With Xalan-J I get the expected result:

<?xml version="1.0" encoding="UTF-8"?>
<out>Hoo Haa !</out>

but with Xalan-C, the parameter is not passed at all:

<?xml version="1.0" encoding="UTF-8"?>
<out>My Default Value.</out>

It's the same with xsl:apply-templates as with xsl:call-template.


Another disparency is with variable values inside loops. With X-C the variable can be updated within the loop, but with X-J it cannot (i.e. it's not visible outside the loop).

--
Otto Chrons - otto.chrons@vvf.fi - http://www.vvf.fi
Virtual Visions Finland - Tel +358-46-41004001 - Fax +358-46-41004010