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

RE: Extract unique list of attributes ...

Subject: RE: Extract unique list of attributes ...
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 22 Jul 2005 18:11:48 +0100
xslt unique list
For all problems involving eliminating duplicate values, or grouping by
common values, see

http://www.jenitennison.com/xslt/grouping

or search on "Muenchian grouping".

If you're using XSLT 2.0, your problem can be solved easily using the
distinct-values() function in XPath 2.0.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Raghupathy S [mailto:raghupathy.s@xxxxxxxxx] 
> Sent: 22 July 2005 17:56
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Extract unique list of attributes ...
> 
> Hi,
> 
> I'm a total newbie to XML / XSl, and I've been stuck with 
> this problem.
> Would be grateful for any suggestions / pointers
> 
> The problem -
> Assuming I have an xml file
> 
> <root>
> <students>
> <student grade="first">abc</student>
> <student grade="first">def</student>
> <student grade="second">ghi</student>
> <student grade="third">jkl</student>
> <student grade="third">mno</student>
> </students>
> </root>
> 
> I need to transform this into the following xml using an XSL
> 
> <root>
> <grades>
> <grade level="first"/>
> <grade level="second"/>
> <grade level="third"/>
> </grades>
> <students>
> <student grade="first">abc</student>
> <student grade="first">def</student>
> <student grade="second">ghi</student>
> <student grade="third">jkl</student>
> <student grade="third">mno</student>
> </students>
> </root>
> 
> 
> I apologize if this is a totally newbie question, but ive been at my
> wits end all day, trying to get this working.
> 
> Any advice / help would be most appreciated.
> 
> Thanks,
> Rags

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.