Re: [xsl] the nearest ancestor with the attribute

Subject: Re: [xsl] the nearest ancestor with the attribute
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 18 Jan 2001 10:20:50 -0500
At 01/01/18 13:07 +0000, Jeni Tennison wrote:
Since I started this confusion in the first place, can I summarise and
check that I've got it right now?

A node set is always unordered until you do anything with it like
iterate over it, get a value from it or whatever.

I find it is more succinct to say: "Nodes from the attribute and namespace axes are always in an arbitrary implementation-defined order, while nodes from all other axes are in proximity order within location step expressions and in document order in location path expressions."


Note that attribute and namespace axes are *not* unordered (you can index into them), just that the order cannot be relied upon. There is an important nuance.

Since a predicate can be applied to a location path expression, as in the union of two other path expressions, that predicate is always evaluated in document order.

xsl:value-of and xsl:for-each deal with location path expressions (not location step expressions), therefore their evaluation is done in document order.

This has proven to be a simple rule-of-thumb for students.

.................... Ken


-- G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995) Web site: XSL/XML/DSSSL/SGML/OmniMark services, training, products. Book: Practical Transformation Using XSLT and XPath ISBN1-894049-05-5 Article: What is XSLT? http://www.xml.com/pub/2000/08/holman/index.html Next public instructor-led training: 2001-01-27,2001-02-21, - 2001-02-27/03-01,2001-03-05/07,2001-03-21, - 2001-04-06/07,2001-05-01,2001-09-19 NB: Monday deadline for early-bird pricing for 3-day hands-on training.


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



Current Thread