Re: [xsl] position() from the attribute axis for getting the position of the parent in respect to its siblings

Subject: Re: [xsl] position() from the attribute axis for getting the position of the parent in respect to its siblings
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 18 Jan 2007 13:22:05 +0000
On 1/18/07, Abel Braaksma <abel.online@xxxxxxxxx> wrote:
I understand it is a waste of time, but it does help me in understanding
the subject, thanks. However, in lieu of this code, can you explain to
me why a for ... in ... return ... loop does not work the same way and
always returns one? I.e., the following returns a sequence of ones,
instead of the expected 1 2 3:

for $elem in ../../day return position()

Or should I read this as the "position of the current element in the
current context, which is the same as current()/position and not the
position that $elem takes in the set of nodes ../../day".

I would be guessing, so I'll leave that one.


This is a nice alternative:

(../../day)/position()

Current Thread