cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <>
Subject Re: problems counting in loops
Date Tue, 24 Oct 2000 11:34:51 GMT
Bas Passon <> wrote:
>I have got a small problem, counting in xsl, see the following fragment of
>	<xsl:variable name="count" select="1"/>
>	<xsl:for-each select="item">
> 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

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 
or look at the FAQ there.

Get Your Private, Free E-mail from MSN Hotmail at

Share information about yourself, create your own public profile at

View raw message