[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Simple Question concerning [last()]


Subject: Re: [xsl] Simple Question concerning [last()]
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 8 Feb 2003 19:12:19 GMT

> I thought the XPath ".//x[last()] should return the last x-Element in
> document order.

the last descendent would be ./descendent::x[last()] or (.//x)[last()]
.//x is 
./descendent-or-self::node()/x
so
./x[last()]
is
./descendent-or-self::node()/x[last()]
and selects every x that is the last x child of its parent.

> Changing the selection to
> ".//x[2] returns nothing at all!

That selects evy x that is teh second x child of its parent.


> Is this a bug in the mentioned XSLT processors or have I missed something?

the latter.

David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords