[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

problem passing parameters to template


Subject: problem passing parameters to template
From: James Williams - Sun East Coast IR Development <James.Williams@xxxxxxxxxxxx>
Date: Thu, 26 Aug 1999 18:42:13 -0400 (EDT)

I'm using XT Version 19990822, and
I'm trying to pass a parameter to a template using
er to a template using
<xsl:set-param>, but it isn't working. The template is
always using the default value for the parameter.

Here is a sample stylesheet:


<xsl:stylesheet	xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
<xsl:output method="text"/>

<xsl:template match="test">
	<xsl:call-template name="letter">
		<xsl:set-param name="format">A</xsl:set-param>
	</xsl:call-template>
	
	<xsl:call-template name="letter">
		<xsl:set-param name="format">B</xsl:set-param>
	</xsl:call-template>
</xsl:template>

<xsl:template name="letter">
	<xsl:param name="format">Z</xsl:param>
	value of format = <xsl:value-of select="$format"/>
</xsl:template>

</xsl:stylesheet>


with the following XML source:

<test>
   <animal name="horse"/>
   <animal name="dog"/>
   <animal name="cat"/>
   <animal name="mouse"/>
</test> 

I get the output:

        value of format = Z
        value of format = Z
        
Is this an XT bug or am I doing something wrong?
I expected to see

        value of format = A
        value of format = B

Thanks, 
Jim Williams


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
xml