Counter variable

"Morgan, Lee" <[email protected]>
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
Hi,

I don't have much experience with xsl, but I have a template the reads a
variable number of lines from an xml file and was wondering if there is
anyway to keep track of how many lines were read and which one is currently
being read.  I need to do something different on line three than the rest of
the lines and don't know of a good way to do it.

<xsl:apply-templates select="DECLARATION"/>
...
...
<xsl:template match="DECLARATION">
[LEFT][CRLF][CRLF]
<xsl:for-each select="LINE">[CRLF]
<xsl:apply-templates/>
</xsl:for-each>
</xsl:template>

<xsl:template match="LINE">
[LEFT]<xsl:value-of select="LINE" />[CRLF]
</xsl:template>


Thanks!

* Lee J Morgan
* Programmer/Analyst
* MT. Dept. of Fish, Wildlife & Parks
* 1420 East 6th Avenue
* Helena, MT  59620
* Phone: (406) 444-1427
* Fax: (406) 444-9733
* E-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.