Re: Changing row colors using variables
[Steve Kuntz] > I know that I can't assign a variable like that...and the logic for the > colors is more complex than every other row. My table will be sorted based > on a certain attribute, and I want all like attributes colored the same. > Sounds like maybe there is no way to do this. > I assume that you don't know what values those attributes may have, just that some will be different. If you knew what they would be, you could just code the values into the stylesheet or (better) use an external xml file defining which colors to use. You ought to be able to do what you ask for by creating a variable that contains the first occurrence of an element with each value of that attribute - a unique list, in other words. Then when you find that attribute, find the position of its parent element in that list and use that position to select the color. This will let you color the same values with the same color. to specify the actual colors to apply you may want to use an external xml file, called in using document() See the FAQs to find out how to create a unique list. Cheers, Tom P 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