RE: [xsl] Get preceding sibling name issue

Subject: RE: [xsl] Get preceding sibling name issue
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 14 Apr 2008 15:59:10 +0100
> Odd examples for 2 reasons:
> 
> - You're asking for the name of the element that you've 
> selected by name
> 
> - The first and last elements on the preceding-sibling axis 
> have the same name, so how will your example show that you 
> have selected the correct element?
> 
> Anyway, the likely answer is that the context node in 
> scenario 2 is different because the elements are a level 
> deeper - they are children of <apara1> rather than <docg> as 
> in the first example.

Agree fully, and it's also worth pointing out that the most recent preceding
sibling is preceding-sibling::*[1], not preceding-sibling::*[last()].
Numeric predicates on a reverse axis step number the nodes in axis order,
not in document order.

Michael Kay
http://www.saxonica.com/

Current Thread