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

call-template dynamically

Subject: call-template dynamically
From: "Yasser El-Zein" <xsl_list@xxxxxxxxxxx>
Date: Fri, 23 Jun 2000 11:33:56 EDT
xsl call template dynamically
this xsl:
<xsl:variable name="var-attr">
	<xsl:choose test="1">attr_1</xsl:choose>
	<xsl:otherwise>attr_2</xsl:otherwise>
</xsl:variable>
<tag><xsl:attribute name="{$var-attr}"/></tag>

produces:
<tag attr_1=""></tag>

while the following xsl:
<xsl:variable name="var-tmplt">
	<xsl:choose test="1">tmplt_1</xsl:choose>
	<xsl:otherwise>tmplt_2</xsl:otherwise>
</xsl:variable>
<xsl:call-template name="{$var-tmplt}"/>

will produce (using xalan):
XSL Error: Could not find template named: {$var-tmplt}

Please explain why the variable named $var-tmplt, when used in xsl:call-template, was not resolved the same way the variable $var-attr was resolved in xsl:attribute?

Also, please suggest a work around?



________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


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.