[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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)
xsl set param
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.