xsl-list
[Top] [All Lists]

Re: Simple Question concerning [last()]

2003-02-08 12:12:19

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



<Prev in Thread] Current Thread [Next in Thread>