This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Numbering
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Numbering
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Thu, 11 Oct 2001 09:20:53 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
Variables don't work like that in a functional language.
Use position().
Mike Kay
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of kobily
> Sent: 10 October 2001 18:14
> To: XSL-List@lists.mulberrytech.com
> Subject: [xsl] Numbering
>
>
> Hi !!!
>
> I have to create a list of options:
> <select>
> <option value="1">Some
> <option value="2">some-elem
> <option value="3">other elem
> </select>
>
> This should be only for the elements that have content (tgis
> have been
> solved), my problem is to give the number of each elem. I
> can´t increase
> a variable.
> I´m using:
>
> <xsl:variable name="values">0</xsl:variable>
> <xsl:for-each select="elem">
> <option><xsl:attribute name="value"><xsl:value-of
> select="$values +
> 1"/></xsl:attribute><xsl:value-of select="elem"/></option>
> </xsl:for-each>
>
> But the variable "values" is always 1.
>
>
> Thanks
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list