cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <KPiroum...@flagship.ru>
Subject Re: problems counting in loops
Date Tue, 24 Oct 2000 10:21:26 GMT
problems counting in loopsBy XSL rules you cannot assign a new value to a
variable.
To implement this kind of counting you have to use recursion.
Btw, to count the number of elements you can use the count() function:

<xsl:variable select="count(items)"/>

Regards,
  Kot.

----- Original Message -----
From: Bas Passon
To: Cocoon Mailinglist (E-mail)
Sent: 24 ??????? 2000 ?., ??????? 13:36
Subject: problems counting in loops


Hello,
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.
Thnx
Bas


Mime
View raw message