This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
A counter inside a for-each?
- To: "Lista Xsl (E-mail)" <xsl-list at mulberrytech dot com>
- Subject: A counter inside a for-each?
- From: Maria Manuel <Maria dot Manuel at si dot efacec dot pt>
- Date: Thu, 23 Mar 2000 16:52:38 -0000
- Reply-To: xsl-list at mulberrytech dot com
- Sensitivity: Company-Confidential
I want to write a "/" only if it´s not the first ocurrence of the Field.
So, I have to use a counter (conta14). But when I display the XML, conta14
has everytime the initial value 0. It doesn't change it!
Do you know any solution to this?!?!
...
<xsl:variable name="conta14">0</xsl:variable>
...
<xsl:template match="/">
...
<xsl:for-each select="//Field[@No='606']/Subfield[@No='a']">
<xsl:if test="$conta14!=0">
<xsl:text> / </xsl:text>
</xsl:if>
<xsl:value-of select="."/>
<xsl:value-of select="$conta14"/>
<xsl:variable name="conta14" select="number('$conta14')+1"/>
</xsl:for-each>
...
</xsl:template>
...
Thanks!
Maria Manuel Rodrigues Teixeira
EFACEC Sistemas de Informação, SA
maria.manuel@si.efacec.pt
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list