This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: call-template with-param problem.
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] call-template with-param problem.
- From: "Sullivan, Dan" <dsullivan at develop dot com>
- Date: Sat, 25 Aug 2001 13:14:08 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
You need to add the param to your template, then access the param with a
value-of. For example:
<xsl:template name="header">
<xsl:param name="title"/>
<h2><xsl:value-of select="$title"/></h2>
</xsl:template>
<xsl:call-template name="header">
<xsl:with-param
name="title">
This is a test
</xsl:with-param>
</xsl:call-template>
Dan
-----Original Message-----
From: Phillip Rhodes [mailto:rhodespc@telerama.com]
Sent: Saturday, August 25, 2001 3:56 PM
To: XSL-List@lists.mulberrytech.com
Subject: [xsl] call-template with-param problem.
I have a named template, that I invoke with a parameter. However, my
result always contains the literal "{$title}".
Thanks very much.
Phillip
<xsl:template name="header">
<h2>{$title}</h2>
</xsl:template>
<xsl:call-template name="header">
<xsl:with-param
name="title">
This is a test
</xsl:with-param>
</xsl:call-template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list