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

RE: Extract unique values

Subject: RE: Extract unique values
From: "SINGH Navpreet" <Navpreet.SINGH@xxxxxxxxx>
Date: Fri, 24 Mar 2006 10:26:52 +1100
xslt unique values
Thanks for your response. Should have used distinct-values() function at
first place.

-----Original Message-----
From: G. Ken Holman [mailto:gkholman@xxxxxxxxxxxxxxxxxxxx]
Sent: Friday, 24 March 2006 9:59 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Extract unique values

At 2006-03-24 09:46 +1100, SINGH Navpreet wrote:
>I want to extract all the <c> from the following xml with uniqe
>values. So in the transformed, no two <c> element should have same

This is a FFFFFFAQ.  Finding uniqueness is a subset of the grouping
problem, so search the web for XSLT Grouping.

In our XSLT 1 training classes we teach that there are three ways to
find uniqueness:  using axes, using keys (the Muenchian method)
http://www.jenitennison.com/xslt/grouping/, and using variables
... each with pros and cons:

Axis method:
  - cons - slow, only sibling-wide or document-wide contexts

Key method:
  - pros - fastest, filtering done in predicates
  - cons - document-wide context

Variable method:
  - pros - document wide, sub-document, or multi-document contexts
         - faster than axis method
  - cons - slower than key method
         - filtering not done in predicates

Grouping is built in to XSLT 2 as a language feature.

I hope this helps.

. . . . . . . . Ken

Upcoming XSLT/XSL-FO hands-on courses: Washington,DC 2006-06-12/16
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread


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.
First Name
Last Name
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.