This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Trying to learn XSL
- To: "xsl-list at mulberrytech dot com" <xsl-list at mulberrytech dot com>
- Subject: Re: Trying to learn XSL
- From: "Juergen Hermann" <jhe at webde-ag dot de>
- Date: Fri, 25 Feb 2000 09:59:31
- Reply-To: xsl-list at mulberrytech dot com
On Thu, 24 Feb 2000 18:04:39 -0600, Tucker Williams wrote:
>I'm wondering if I need a function to do this, something like:
>
><xsl:choose>
> <xsl:when expr="[position() mod 2] =1">
> some html
> </xsl:when>
> <xsl:when expr="[position() mod 2] =0">
> some html
> </xsl:when>
></xsl:choose>
This is exactly what you need. One modification though, define a variable for
the color using <xsl:variable> and use that variable AFTER the choose.
Why? You cannot just emit the font, td or whatever tag containing the color
WITHIN the whens, since that would not be well-formed XML.
Ciao, Jürgen
--
Jürgen Hermann (jhe@webde-ag.de)
WEB.DE AG, Amalienbadstr.41, D-76227 Karlsruhe
Tel.: 0721/94329-0, Fax: 0721/94329-22
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list