xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Apply Templates question


Subject: [xsl] Apply Templates question
From: Bennett <bennett@xxxxxxxxxxxxx>
Date: Mon, 20 Oct 2003 13:42:59 -0400

Hello,

Is there a way to apply a template stored in a variable or param?


Example, In my test stylesheet, I currently have:

...

<xsl:param name="template" select="'default'"/>
<xsl:param name="testTemplate"/>

<xsl:template match="/">
	<xsl:apply-templates select="document('')/*"/>
</xsl:template>

<xsl:template match="xsl:template[@name = '$template']">
	<xsl:param name="testTemplate"><xsl:copy-of select="."/></xsl:param>
</xsl:template>

<xsl:template name="default">
	Made it to test.xsl - default template
</xsl:template>	
...


Which will allow a template to be selected based on a param but I'm not sure how to apply the template that gets stored in "testTemplate"
(Or rather, how to apply the selected template once it's been matched by xsl:template[@name= '$template'])


Does anyone know where to go from here or have alternate suggestions?

TIA


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




Current Thread
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor