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

question about call-template

Subject: question about call-template
From: "Reid M. Pinchback" <reidmp@xxxxxxx>
Date: Sat, 29 Jan 2000 20:40:06 -0500
call template xslt
[Apologies if anybody has seen this message before.  I'm pretty sure the
 listserv never sent it out the first time, but the archive on Mulberry's
 web site is broken and I can't check to make sure.]

I'm stumped.

I've learned how to write a template.  Ditto for calling a template by name,
and for passing parameters to a template.

I can't find a way to pass the *name* of a template to another template,
and then call that template by that name.  In other words, something like:

<xsl:template match="/">
    <xsl:call-template name="A">
      <xsl:with-param name="Tpl">B</xsl:with-param>

<xsl:template name="A">
  <xsl:param name="Tpl"></xsl:param>
  <xsl:call-template name="$Tpl"></xsl:call-template>

<xsl:template name="B">

Should this be possible?  I'm using IBM's XSL processor, but when I try 
this I just get:

    "XSL Error: Could not find template named: '$Tpl'

Basically what I'm looking for is the same kind of functionality you get
in languages that allow you to pass a function by reference.  That way
I could create one template that did common processing, and pass a
specialized template to it to handle issues specific to the portion
of the document tree I'm trying to process (eg: create a generic reusable
table layout vs dealing with content-specific layout issues in the rows).

Thanks in advance for any assistance.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.