[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: xsl which template

Subject: RE: xsl which template
From: Matt Elder <M.Elder@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Feb 2001 08:42:32 +1000
xsl which
> 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.