[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Global extension function

Subject: Re: Global extension function
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 24 Feb 2003 16:42:36 +0000
extension jeni
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:choose>
        <xsl:when test="position() mod 3 = 1">white</xsl:when>
        <xsl:otherwise>#d4e3ff</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <div style="background-color: {$background};
                color: black; margin-top: 0px; margin-left: 2px;
                margin-right: 2px; margine-bottom: -19px">
      ...
    </div>
  </xsl:for-each>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.