cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: problems counting in loops
Date Tue, 24 Oct 2000 11:34:51 GMT
Bas Passon <BPasson@parite.nl> wrote:
>I have got a small problem, counting in xsl, see the following fragment of
>code
>
>	<xsl:variable name="count" select="1"/>
>	<xsl:for-each select="item">
>		...do something
>		<xsl:variable name="count" select="$count+1"/>
>	</xsl:for-each>
>
>for some reason the count variable stays 1. What am i doing
>wrong. I looked at the XPath docs, but this is a valid
>expr.

Yes, valid expression - but invalid assignment. Variables cannot be changed 
in XSLT - yes, I know it's a pain. To count things use the count() function 
- that's what it's there for!

In future please ask XSL questions on the XSL list at www.mulberrytech.com 
or look at the FAQ there.


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message