This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: counting and displaying with xsl?
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: counting and displaying with xsl?
- From: Jim Clement <JClement at CareInsite dot com>
- Date: Wed, 7 Jun 2000 15:44:52 -0400
- Reply-To: xsl-list at mulberrytech dot com
I if you're in a loop, I would use mod and position. Here's something I did
to make colored bars in an HTML "person list" table
<xsl:for-each select="Person">
<TR>
<TD>
<xsl:attribute name="BGCOLOR">
<xsl:choose>
<xsl:when test="position() mod 2 =
1">#FFFFFF</xsl:when>
<xsl:when test="position() mod 2 =
0">#DBDBDB</xsl:when>
</xsl:choose>
</xsl:attribute>
<A HREF="personlink.html">
<xsl:value-of select="PersonName" />
</A>
</TD>
</TR>
</xsl:for-each>
>-----Original Message-----
>From: juggy@gmx.net [mailto:juggy@gmx.net]
>Sent: Tuesday, June 06, 2000 8:07 PM
>To: xsl-list@mulberrytech.com
>Subject: counting and displaying with xsl?
>
>
>Hi,
>
>Is there any way to use xsl to count the number of items in my
>xml? I'd like to know this so I could arrange them according to their
>number (e.g. have a line break every 5 items).
>I think of something like
><xsl:if "count > 5">
> ARRANGE NORMAL
><xsl:if-otherwise>
> LINEBREAK
> ARRANGE NORMAL
>...
>
>Juggy
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list