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

[xsl] counting the preceding cousins of an element


Subject: [xsl] counting the preceding cousins of an element
From: Carlo Liwanag <cliwanag@xxxxxxxxxxxx>
Date: Thu, 15 Jun 2006 14:43:13 +0800

Hi,
I am trying to get the number of preceding cousin of an element but I can't seem to work on it.
I tried using the axes but I guess it could not reference the same ancestor. For example,
<chapter>
<para>
some text here
<footnote>
some text here
<footnote>
</para>
<para>
some text here
<footnote>
some text here
<footnote>
some text here
<footnote>
some text here
<footnote>
</para>
<para>
some text here
<footnote>
some text here
<footnote>
</para>
</chapter>
<chapter>
...
</chapter>
<chapter>
...
</chapter>


In this example, the footnote is the element and the ancestor is the chapter.
How can I find the preceding::footnote[ancestor::chapter[descendant::"is the current node"]]?


Thanks,
Carlo


Current Thread