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

Accessing multiple values of an attribute

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

I have xml similar to the following


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


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

Question:
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

Karen



 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.