This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: question on calling templates
- From: "Noel Golding" <noel at spearreport dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 29 Aug 2002 17:20:40 -0400
- Subject: Re: [xsl] question on calling templates
- References: <E81CDB637D61D511A92800D0B7E4C9D80C9905B6@gsny30e.ny.fw.gs.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
try
<xsl:call-template name="{$currentTemplate}"/>
----- Original Message -----
From: "Rotkop, Eugene" <Eugene.Rotkop@gs.com>
To: <XSL-List@lists.mulberrytech.com>
Sent: Thursday, August 29, 2002 4:17 PM
Subject: [xsl] question on calling templates
> Hi,
>
> I was wondering if there is a way to store template name in the variable
and
> then call template.
> So, the sample XSL would be following:
>
> <xsl:variable name="currentTemplate" select="'test'"/>
> <xsl:call-template name="$currentTemplate"/>
>
> Seems like XSLT does not allow this. Am I using the wrong syntax? Can this
> be achieved in any other way?
>
> The reason I am asking about this is that I am trying to use multiple
> templates to create
> header, body and footer for a web page. Header and footer stays the same
for
> all the pages. However,
> body always changes. If I assign template names to header, footer and
body,
> I can call them to apply these templates.
> I want to be able to call diffent body templates depending on the value of
a
> variable.
>
> Any help would be appreciated.
>
> Thanks,
> Eugene
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list