dsraja
asked on
Xsl:call-template
Can the name attribute of a xsl:call-template be a xsl variable or xml tag?
I want the calling template name as a variable.
like
<xsl:call-template name="$tname"/> (But this will give an error)
How to achieve this?
I want the calling template name as a variable.
like
<xsl:call-template name="$tname"/> (But this will give an error)
How to achieve this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<?xml-stylesheet type="text/xsl" href="D:\Projects\XML Framework\Untitled2.xsl"?>
<xml>
<circle radius="10"/>
<rectangle length="20" height="30"/>
</xml>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/xml">
<xsl:for-each select="*">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<xsl:template match="circle">
<p>I'm a circle with radius <xsl:value-of select="@radius"/></p>
</xsl:template>
<xsl:template match="rectangle">
<p>I'm a rectangle</p>
</xsl:template>
</xsl:stylesheet>
Something like this ??