This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: <xsl:copy-of>
- To: "Palaniappan, Krishnasamy" <PalaniK at diebold dot com>
- Subject: Re: [xsl] <xsl:copy-of>
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Wed, 10 Jan 2001 01:06:25 +0000
- CC: "'xslt'" <XSL-List at lists dot mulberrytech dot com>
- Organization: Jeni Tennison Consulting Ltd
- References: <B56CDE69406ED211844700A02461EDDE02A780F2@a09devlab.diebold.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Krish,
> I have a variable defined like this:
> <xsl:variable name="try">
> <xsl:call-template name="tableheadingDT">
> <xsl:with-param name="bcolor" select="'LIGHTSKYBLUE'"/>
> </xsl:variable>
> I want to call it using:
> <xsl:copy-of select="$try"/>
> <xsl:with-param name="param1" values="'value1'"/> <!-- 2nd parameter to the template above is passed here -->
> </xsl:call-template> <!-- closing the template opened above -->
It's not exactly clear what you're trying to achieve with this. Is it
that you have two calls to the 'tableheadingDT' template and want to
make sure that the second call uses the same parameter values as the
first, as well as the additional one? In other words, do you want a
less repetitive method than:
<xsl:call-template name="tableheadingDT">
<xsl:with-param name="bcolor" select="'LIGHTSKYBLUE'" />
</xsl:call-template>
<xsl:call-template name="tableheadingDT">
<xsl:with-param name="bcolor" select="'LIGHTSKYBLUE'" />
<xsl:with-param name="param1" select="'value1'" />
</xsl:call-template>
You could put the value for the $bcolor parameter into a variable, and
use that in both calls:
<xsl:variable name="bcolor" select="'LIGHTSKYBLUE'" />
<xsl:call-template name="tableheadingDT">
<xsl:with-param name="bcolor" select="$bcolor" />
</xsl:call-template>
<xsl:call-template name="tableheadingDT">
<xsl:with-param name="bcolor" select="$bcolor" />
<xsl:with-param name="param1" select="'value1'" />
</xsl:call-template>
But other than that, the closest you can get is to declare a general
entity that holds the xsl:with-param for the $bcolor parameter and use
that:
<!ENTITY bcolor-param
'<xsl:with-param name="bcolor" select="'LIGHTSKYBLUE'" />'>
[I think] and then:
<xsl:call-template name="tableheadingDT">
&bcolor-param;
</xsl:call-template>
<xsl:call-template name="tableheadingDT">
&bcolor-param;
<xsl:with-param name="param1" select="'value1'" />
</xsl:call-template>
Sorry I can't be more help. Perhaps if you described what you wanted
to achieve we could find something else,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list