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

Re: ancestor::* and for-each

Subject: Re: ancestor::* and for-each
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Jul 2010 12:33:34 -0400
Re:  ancestor::* and for-each
At 2010-07-28 18:11 +0200, Wolfgang Laun wrote:
I use ancestor-or-self::* to obtain the node sequence from some node
to the document root.

Remember in XSLT it is ordered in document order even though it was addressed in XPath in reverse document order.


The outermost/top element of the document isn't interesting, so I add
a predicate, and I find that this works:
   [position() != last()]

Actually position()>1 will omit the document element.


Apparently, the sequence goes from leaf to root, which is the closing
tag order, as it should be.

Really? I would have expected your node list to be in document order.


Then, I iterate over the sequence, and now the nodes are processed
from root to leaf, which is strange.

No, that is what I would expect.


There is a Note in Chapter 7, Repetion, that sounds as if it is
related to this, but, frankly, I don't understand it.
What does it mean, in monosyllabic words, please ;-)

I hope this helps: "in XSLT a node set is ordered in document order even though it was addressed in XPath in reverse document order".


. . . . . . . . Ken

--
XSLT/XQuery training:   after http://XMLPrague.cz 2011-03-28/04-01
Vote for your XML training:   http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.