This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: xsl which template


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]