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

telling an outer template which template to call...

Subject: telling an outer template which template to call...
From: Felix Breuer <felix@xxxxxxxxxx>
Date: 01 Sep 2003 22:13:05 +0200
outer template
Hello!

I would like an outer template to call an inner template which is
specified by a parameter. I.e. I would like to get the following example
working:

<xsl:template match="/">
  <xsl:apply-templates select="foo">
    <xsl:with-param name="para">bar</xsl:with-param>
  </xsl:apply-templates select="foo">
</xsl:template>

<xsl:template match="foo">
  <xsl:param name="para">moo</xsl:with-param>
  ...
  <xsl:call-template name="{$para}"/>
  ...
</xsl:template>

<xsl:template name="bar">...</xsl:template>
<xsl:template name="moo">...</xsl:template>

I hope the above makes it clear what I am aiming at. [Obviously the
whole stylesheet is going to be a bit more complicated or such an
involved solution wouldn't be necessary.]

Now, when I run the above through xsltproc (libxslt) I get errors like

xsl:call-template : template {$para} not found

Obviously, the problem is that the parameter $para is not expanded
before the call-template element is executed.

My questions are:
1) Is $para supposed not to be expanded in time? Or is this a bug in
libxslt?
2) Is there a way to get this stylesheet working? With libxslt or any
other processor?

Thanks in advance,
Felix Breuer


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


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.