|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] problem passing parameters to template
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








