xsl-list
[Top] [All Lists]

Re: [xsl] position last and attributes

2012-09-20 05:11:55
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(_dot_)onwuka(_at_)googlemail(_dot_)com> wrote:
It would seem (somewhat paradoxically) that given the definition of
position() and last() they could be applied to @* which is
intrinsically unordered.



-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--