xsl-list
[Top] [All Lists]

Xpath and xsl position question

2003-06-15 20:15:24
Hello,
   Here's how my xml looks.
   
<header>header one</header>
<chapter>H1 chapter one</chapter>
<chapter>H1 chapter two</chapter>
<chapter>H1 chapter three</chapter>
<header>header two</header>
<chapter>H2 chapter one</chapter>
<chapter>H2 chapter two</chapter>
<header>header three</header>
<chapter>H3 chapter one</chapter>
<chapter>H3 chapter two</chapter>
<chapter>H3 chapter three</chapter>

I have 2 questions.
1. When I am inside chapter template, how do I know if
it's the last chapter after each header ?
   Example:
   if(
   H1 chapter three
   H2 chapter two
   H3 chapter three) then do...blah
2. How do I find the position of header when I am
inside chapter template ?
   I tried <xsl:value-of select="../position()"/>. But
that didn't help.

<xsl:apply-template match="chapter">
        1. if(last chapter node) then do..... blah
        2. position of header ?
</xsl:template>

Your help is appreciated.

Thanks a lot.
Mark

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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



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