[xsl] Xpath and xsl position question

Subject: [xsl] Xpath and xsl position question
From: Mark Ivs <markivs2003@xxxxxxxxx>
Date: Sun, 15 Jun 2003 20:15:24 -0700 (PDT)
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


Current Thread