[Home] [By Thread] [By Date] [Recent Entries]
Hi Karl,
I think you can use something like below: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:x="http://example.com/myTemplates"> <xsl:template match="@x:template1" x:template1="">
<xsl:param name="contextNode"/>
<xsl:for-each select="$contextNode">
In template1!
</xsl:for-each>
</xsl:template> <xsl:template match="@x:template2" x:template2="">
<xsl:param name="contextNode"/>
<xsl:for-each select="$contextNode">
In template1!
</xsl:for-each>
</xsl:template><xsl:template match="/*"> <xsl:variable name="target" select="'template1'"/> <xsl:apply-templates select="document('')/*/xsl:template[@x:*[local-name()=$target]]"> <xsl:with-param name="contextNode" select="."/> </xsl:apply-templates> </xsl:template> </xsl:stylesheet> I believe FXSL also has something similar, you might check that as well. Best Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Karl wrote: I am in a situation where in a particular section need to call different template dynamically based on which template invokes it. Though I can use <xsl:choose> or <xsl:if> to do that, i wish i pass the template name as a param value.
|

Cart



