[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Alternate bg colors for table and address summaries
Paul Essex wrote: > [...] > Take a look at page 367 in Michael Kay's XSLT book. The very > last entry in > the Examples table shows this method of determining whether a node's > position is even: > > item[position() mod 2 = 0] > > Use this in an xsl:when test something like this: > > <xsl:choose> > <xsl:when test="Summary[position() mod 2 = 0]> > <xsl:call-template name="bgcolorgrey"/> > </xsl:when> > <xsl:otherwise> > <xsl:call-template name="bgcolorwhite"/> > </xsl:otherwise> > </xsl:choose> I think I'd use stylesheets. Then, your could do something like <tr> <xsl:choose> <xsl:when test="Summary[position() mod 2 = 0]> <xsl:attribute name="class"/>bgcolourblack</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="class"/>bgcolourblack</xsl:attribute> </xsl:otherwise> </xsl:choose> <!-- all the other stuff for the row --> </tr> - Joerg XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|