Re: [xsl] Global extension function

Subject: Re: [xsl] Global extension function
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 24 Feb 2003 16:42:36 +0000
Hi TP,

> What I want to do is change the background color of the table every
> 3 lines. This is the only way that I have found to do this. If you
> or someone have some ideas on how to solve this using standard xsl,
> I would appreciate it.

Use position() mod 3 = 1 to identify every third line, so something
along the lines of:

  <xsl:for-each select="line">
    <xsl:variable name="background">
        <xsl:when test="position() mod 3 = 1">white</xsl:when>
    <div style="background-color: {$background};
                color: black; margin-top: 0px; margin-left: 2px;
                margin-right: 2px; margine-bottom: -19px">



Jeni Tennison

 XSL-List info and archive:

Current Thread