This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

A counter inside a for-each?


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]