Subject: RE: Order That Nodes Are Processed
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 6 Jan 2004 18:28:28 -0000
|
> If I have an <xsl:apply-template select="some criterion"> or
> <xsl:for-each select="some criterion"> statement in my
> stylesheet, am I guranteed that the nodes will be processed
> in the exact order that the qualifying nodes appear in the XML file?
>
Yes, the nodes are processed in document order.
A caveat if you want to be pendantic: this means that the result of
processing node A will appear in the result tree before the result of
processing node B if and only if A is before B in the input document (in
both cases "before" refers to "document order"). This has nothing to do
with the chronological sequence of processing: the XSLT processor can
process the input backwards and create the result tree backwards if it
feels like it.
Michael Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|