RE: [xsl] Order of template execution

Subject: RE: [xsl] Order of template execution
From: "Avula, Raj" <RAvula@xxxxxxxxxxx>
Date: Wed, 19 Dec 2001 18:50:29 -0800

> -----Original Message-----
> From:	Samuel Abraham [SMTP:samuel.abraham@xxxxxx]
> Sent:	Wednesday, December 19, 2001 5:32 PM
> To:	xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:	[xsl] Order of template execution
> 
> 
> 
>   hi,
> 
> In an xsl file i have  templates in this order
> 
> Template 1
> Template 2
> Template 3
> 
> 1)Is there any order in which the templates are executed?
	[Avula, Raj]  
		If you have templates like
			<root_template>
				<template1/>
				<template2/>
				<template3/>
			</root_template>
	and if call <xsl:apply-templates select="root_template" />
	all the templates will be executed in the same order as the input
xml.


>     If I change the order will the result change?
	[Avula, Raj]  
	Yes. If the order of templates in the input xml is changed, then
result target will be changed accordingly.

> 2)Will the change made by one template affect the source tree?
>     Or can I use the result produced by the first template as the source
> tree for the
>           templates following?
	[Avula, Raj]  
		Yes. You can call the first template using apply-templates,
store results in a variable and pass that
	variable as the parameter to the second template

		<xsl:variable name="var_template1">
			<xsl:apply-templates select="template1" />
		</xsl:variable>

		<xsl:apply-templates select="template2">
			<xsl:with-param name="var_template1"
select=$var_template1 />
		</xsl:apply-templates>




>  thanks
>   Samuel Abraham
> 
> 
> 
> --
> 
> This e-mail may contain confidential and/or privileged information. If you
> are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail. Any
> unauthorized copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden.
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

"MMS <firstam.com>" made the following
 annotations on 12/19/01 18:51:34
------------------------------------------------------------------------------
"THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE INTENDED SOLELY FOR THE USE OF THE INDIVIDUAL(S) ADDRESSED AND MAY CONTAIN CONFIDENTIAL, PROPRIETARY OR PRIVILEGED INFORMATION.  IF YOU ARE NOT THE ADDRESSEE INDICATED IN THIS MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS MESSAGE TO SUCH PERSON) YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE THIS MESSAGE OR ANY FILES TRANSMITTED HEREWITH.  IF YOU RECEIVE THIS MESSAGE IN ERROR, PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE THIS MESSAGE AND ALL COPIES OF IT FROM YOUR SYSTEM."

==============================================================================


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


Current Thread