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]

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

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