This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

xsl:call-template question


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]