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

RE: Order of template execution

Subject: RE: Order of template execution
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 20 Dec 2001 10:28:16 -0000
xsl templates tree reorder
> 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?
>     If I change the order will the result change?

No. XSLT template rules follow an event-based processing model. A template
rule says "if X is encountered, do this". The order of processing is
determined by the order of events, not the textual order of the rules.

There's one exception: if you have two template rules that match the same
"event" (i.e. the same node in the source document), it's technically an
error, but the processor can resolve the ambiguity by choosing the rule that
comes last in the stylesheet.
>
> 2)Will the change made by one template affect the source tree?

Nothing done by a stylesheet ever affects the source tree. Templates write
new nodes to the result tree, without changing the source tree.

Mike Kay


 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.