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

xsl:call-template question

Subject: xsl:call-template question
From: Joni Fazo <joni@xxxxxxxxxxx>
Date: Wed, 16 Feb 2000 11:36:38 -0800
xsl template in xsl
Title: xsl:call-template question

Hello,

Is it possible to call a template and pass in as a parameter the name of the template you would like the called template to call?

Here's a (non-working) example of what I am trying to do:

<!-- / Template -->

<xsl:template match="/">
<HTML>
<xsl:call-template name="buildpage">
        <xsl:with-param name="nexttemplate">buildbody</xsl:with-param>
</xsl:call-template>
</HTML>
</xsl:template>

<!-- buildpage Template -->

<xsl:template name="buildpage">
        <xsl:param name="nexttemplate">defaulttemplate</xsl:param>
        <xsl:value-of select="$nexttemplate"/>
        <xsl:call-template name="{$nexttemplate}"/>
</xsl:template>

<!-- buildbody Template -->

<xsl:template name="buildbody">
<BODY> 
</BODY>
</xsl:template>

I get the error "No named template "{$nexttemplate}" found" when the line
<xsl:call-template name="{$nexttemplate}"/>
is processed.  I am able to get the value of $nexttemplate though...

Thanks in advance for any help you can give me.

Joni

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.