This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xsl which template
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] RE: xsl which template
- From: Matt Elder <M dot Elder at secureinteractive dot com>
- Date: Thu, 22 Feb 2001 08:42:32 +1000
- Reply-To: xsl-list at lists dot mulberrytech dot com
> That is, I'd like to apply 2 different templates to the SAME xml file.
Mike Kay suggested using JScript but an alternative would be to use a
combination of template matches and call templates.
ie Sample XML
<root>
<level1>
<level2></level2>
</level1>
<level1>
<level2></level2>
</level1>
</root>
Sample XSL
<xsl:apply-templates select="root/level1"/>
<xsl:call-template name="JoeBloggs"/>
<xsl:template match="level1">
<!-- some form of processing -->
</xsl:template>
<xsl:template name="JoeBloggs">
<!-- some form of processing -->
</xsl:template>
Thus in one template you can carry out processing on the XML and in the
named template you can do something else. Saves having to use JScript.
Just a thought
Matt
www.mattelder.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list