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

RE: sorting data and removing the duplicates

Subject: RE: sorting data and removing the duplicates
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 19 Jun 2000 12:50:02 +0100
xslt sort and remove duplicates
See the FAQ under sorting and grouping.

Since this is a huge list, I would use keys. Eliminate the duplicates by
testing each node to see whether it is the first one with that key value,
using the test
generate-id(.)=generate-id(key('keyname',.)[1])

Mike Kay

> -----Original Message-----
> From: Ronald [mailto:ronald@xxxxxxxxxxx]
> Sent: 19 June 2000 11:39
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: sorting data and removing the duplicates
> 
> 
> Hi there,
> 
> I've encountered the following:
> 
> I have a huge list of variables being set ( it's a xml file)
> and with XSLt i want to sort  this file on alfabetical order
> and then remove the duplicates.
> The xml file sort of looks like this:
> 
> <value><var>date1</var><date>01-01-1999</date></value>
> <value><var>date2</var><date>01-02-1999</date></value>
> <value><var>date3</var><date>01-01-1999</date></value>
> <value><var>date2</var><date>01-02-1999</date></value>
> 
> I found that sorting this list was not so difficult, but removing the 
> duplicates...erm...
> I dunno how to do that with XSLT.
> My current list looks like this:
> 
> <value><var>date1</var><date>01-01-1999</date></value>
> <value><var>date2</var><date>01-02-1999</date></value>
> <value><var>date2</var><date>01-02-1999</date></value>
> <value><var>date3</var><date>01-01-1999</date></value>
> 
> But I want something that looks like:
> 
> <value><var>date1</var><date>01-01-1999</date></value>
> <value><var>date2</var><date>01-02-1999</date></value>
> <value><var>date3</var><date>01-01-1999</date></value>
> 
> BTW:
> The content of the var. is enough to do a search on, F.E. 
> date2 always gets 
> the same value.
> 
> Can any of you help me out here?
> 
> Best regards
> RH
> ---------||-------||-----------
> Ronald Heller
> Salience BV
> Villawal 21
> 3432 NX Nieuwegein
> tel.: 030 60 56 675
> fax: 030 6056 324
> mob.: 06 20 41 25 77
> ronald@xxxxxxxxxxx
> www.salience.nl
> 
> 
>  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.