Re: [xsl] position last and attributes

Subject: Re: [xsl] position last and attributes
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Thu, 20 Sep 2012 15:41:20 +0530
Hi Ihe,
    I think your confusion comes from the fact that, you want to get
position of a node in the sequence as per document order. If that's
your objective, then I think this problem can't be solved for
attributes (due to it's unordered semantics at the XML level).

For elements, we can probably solve this by means other than
position() and last() functions (these functions are not aware of
document order, as has been discussed). If you are at a context node,
then you could do for example count(preceding::node()) + 1, to know
the position of the context node as per document order.

On Thu, Sep 20, 2012 at 11:43 AM, Ihe Onwuka <ihe.onwuka@xxxxxxxxxxxxxx> wrote:
> It would seem (somewhat paradoxically) that given the definition of
> position() and last() they could be applied to @* which is
> intrinsically unordered.

Mukul Gandhi

Current Thread