[Home] [By Thread] [By Date] [Recent Entries]
On 2/14/07, alex v. <alex.vett@xxxxxxxxx> wrote:
Hi all, I would like to know distance between two sibling nodes. One solution maybe is to count siblings between the two nodes. So, I have a sequence of sibling node, for example:
I think that count(preceding-sibling::a[1]) is the solution, but it seems don't work for me. Why this? It's on the right track, try this: select="count(.|preceding-sibling::*[. >> current()/preceding-sibling::a[1]])" In words, this says: "Count all preceding-siblings that occurs after the closest preceding-sibling <a> in document order" - the . includes the current element itself to increase the count by one to get the number you're after. cheers andrew
|

Cart



