[xsl] Accessing multiple values of an attribute

Subject: [xsl] Accessing multiple values of an attribute
From: "Clifford, Karen" <Karen.Clifford@xxxxxxxxxxxx>
Date: Tue, 1 Oct 2002 16:55:01 +0100
Hello everyone, 

I have xml similar to the following

<Table stripes="blue red green purple">
				<Content> First Row</Content>
				<Content> Second Row</Content>
				<Content> Third Row</Content>
				<Content> Fourth Row</Content>
				<Content> Fifth Row</Content>
				<Content> Sixth Row</Content>

The number of values existing in the stripes attribute is variable (not
always 4), and the rows in the table can also be of different numbers (i.e.
I could get one with 20 rows)
Using xsl, I must access the values of the 'stripes' attribute and colour
the rows of the box.....i.e. in the above case, the box has 6 rows and 4
different colours so I want my rows to be coloured in the following way: 
Row 1: blue
Row 2: red
Row 3: green
Row 4: purple
Row 5: blue
Row 6: red   etc
 "         green
 "         purple

First of all, how do I access the different values of the stripes attribute
(is there an easy way that I have overlooked?)?
I need to know 
(a) how many of them there are (for my mod function)
(b) what values they have. 

I was trying string-before and string-after but that could get messy if I
got alot of different colours.

Thanks & Regards


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

Current Thread