|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Newbie Question: call-template name="$variable"
> Here's what I want to do:
>
> <!-- For Each Recordset/Record ... -->
> <xsl:template match="RECORD">
> <TR>
> <xsl:variable name="record_type" select="@TYPE"/>
> <xsl:call-template name="$record_type"/>
> </TR>
> </xsl:template>
>
Well you can't, sorry! The name has to be a QName, it can't be an
expression, and it can't be an attribute value template. A QName can't have
a "$" in it.
It looks to me as if your situation can be handled by changing
<xsl:call-template ...> to <xsl:apply-templates mode="x"/>,
and replacing
<xsl:template name="type1"> by <xsl:template match="RECORD[@TYPE='type1']"
mode="x">
If you really need to call a named template decided at run-time, you can do
it in Saxon as
<xsl:call-template name="{$rectype}" saxon:allow-avt="yes"/>
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








