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

Re: two-toned background....

Subject: Re: two-toned background....
From: Mike Brown <mike@xxxxxxxx>
Date: Tue, 29 Aug 2000 16:03:27 -0600 (MDT)
two toned backgrounds
Dickson, Dan wrote:
> i am formatting a report so that it has a two-colored background,
> alternating grey & white using two CSS classnames class1 and class2 in HTML
> table <TD> tags.

so like each column is alternating grey and white?

> to get class1 or class2 in my XSL i do: select="position() mod 2" in the
> attribute of the TD tag and paste the 1 or 2 to the word 'class'

that sounds right. something like

<td class="class{position() mod 2}">
 ...
</td>

> the problem i am having is that my XML structure is about 4 levels deep, and
> I need to know the position() for members that are BELOW the first <TD> in
> each row (if that makes any sense...in other words i need to put the same
> position() mod value for each <TD> in a given <TR>, but how can i "carry"
> this value between different nodesets in the XML document hierarchy?).

position() is always the position of the current node, relative to the
nodes in the current node list, which were selected in the most recent
xsl:apply-templates or xsl:for-each.

if the current node list keeps changing from one row to the next, you
still have the node for the first column at position 1, the node for the
second column at position 2, etc., so without seeing your XML, XSLT and
what output you're really trying to produce, i can only guess at what the
problem might be. perhaps you aren't selecting ideal node-sets.

(x)html table construction with xslt is always a fun exercise in
inside-out logic...

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at         My XML/XSL resources:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


 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.