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

Re: Reverse axis, reverse document order, xsl:for-each

Subject: Re: Reverse axis, reverse document order, xsl:for-each
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Thu, 28 Feb 2008 12:02:43 +0100
Re:  Reverse axis
Michael Kay schrieb:
XSLT 1.0 models the result of any path expression as a set of nodes
in no particular order. The semantics of xsl:for-each are that it
processes this set in the order determined by its xsl:sort
specification; the default for this is "document order".

You can reverse this using <xsl:sort select="position()"
order="descending" data-type="number"/>

Now, that's just great! Golden advice!


The way the semantics are modelled changes significantly in XSLT 2.0,
though of course backwards compatiblity has been retained.

Why is this so?

Depends who you ask. Committees move in mysterious ways. It can be hard to work out why a decision was made even if you were present at all the meetings - which in this case, I wasn't.

Mysterious ways. Easy enough to accept. Especially with the above-mentioned position() trick at hand. I won't question further.

And, last question, is there a way to have a pointer
(xsl:variable) to nodes in RDO without resorting to copying
or reconstructing?

Not in 1.0: the type system only allows sets of nodes, not sequences. 2.0 changes that.

Michael Kay

Thanks a lot, Michael!


Michael Ludwig

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.