Re: Axis order and variables
Consider the following XML
In your example the answer is "1".
If you had written:
you would have received the answer of "2".
If this is all what we have then the result of the above test should be "1", since the value of a variable is an object rather than an expression and thus is an (unordered) node-set.
Actually, XSLT orders the unordered node-set in document order, which is why the first one is returned.
Therefore, its members, when forced to be ordered, should be ordered in document order.
Precisely ... which XSLT 1.0 does.
Is it a definite answer?
Does it depend on a realization?
It shouldn't ... it is well defined.
I have run into this question because the result of MSXML 3.0 and Saxon differs from that of MSXML 4.0: the former give "1", while the latter gives "2". Who is right? Or they are both right?
If what you say is true, then MSXML 4.0 is not producing the result according to XSLT 1.0. I'm running IE6 which, I thought, was running MSXML 4.0 and yet I get the correct answer.
I hope this helps.
-- Upcoming hands-on courses: (registration still open!) - (XSLT/XPath and/or XSL-FO) North America: June 16-20, 2003
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 (F:-0995) ISBN 0-13-065196-6 Definitive XSLT and XPath ISBN 0-13-140374-5 Definitive XSL-FO ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-11-X Practical Formatting Using XSL-FO Member of the XML Guild of Practitioners: http://XMLGuild.info Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format