[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

A counter inside a for-each?

Subject: A counter inside a for-each?
From: Maria Manuel <Maria.Manuel@xxxxxxxxxxxx>
Date: Thu, 23 Mar 2000 16:52:38 -0000
xsl for each counter
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@xxxxxxxxxxxx


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.