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

RE: Grouping elements by attribute values

Subject: RE: Grouping elements by attribute values
From: DIDM <peter@xxxxxxxxxx>
Date: Tue, 17 Oct 2000 22:15:44 +0100
didm
Correction

transformed to:

<foos>
	<foo rl="C" wl="W" fo="CW1 CW2"/>
	<foo rl="B" wl="W" fo="BW1"/>
	<foo rl="A" wl="W" fo="AW1"/>
	<foo rl="C" fo="C1 C2 C3"/>
	<foo rl="B" fo="B1"/>
	<foo rl="A" fo="A1"/>
</foos>

Peter Sparkes

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of DIDM
Sent: 17 October 2000 19:49
To: xsl-list
Subject: Grouping elements by attribute values


HI,
Help Please.

I have a set of foo elements. Each foo element has an rl attribute and may
have a wl attribute.
eg.

<foos>
	<foo rl="C" wl="W">CW1</foo>
	<foo rl="C" wl="W">CW2</foo>
	<foo rl="B" wl="W">BW1</foo>
	<foo rl="A" wl="W">AW1</foo>
	<foo rl="C" >C1</foo>
	<foo rl="C" >C2</foo>
	<foo rl="B" >B1</foo>
	<foo rl="A" >A1</foo>
	<foo rl="C" >C3</foo>
</foos>

I want to transform the set such that:

a.  For each unique set of rl and wl attributes there is only one element.
b.  The element values are tramsformed into an NMTOKENS list in the element
with the appropriate attribute set.

ie. to:

<foos>
	<foo rl="C" wl="W">CW1 CW2</foo>
	<foo rl="B" wl="W">BW1</foo>
	<foo rl="A" wl="W">AW1</foo>
	<foo rl="C" >C1 C2 C3</foo>
	<foo rl="B" >B1</foo>
	<foo rl="A" >A1</foo>
</foos>

Peter Sparkes


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


 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.