xsl-list
[Top] [All Lists]

RE: Extract unique list of attributes ...

2005-07-22 10:11:48
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(_dot_)s(_at_)gmail(_dot_)com] 
Sent: 22 July 2005 17:56
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>