[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: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Mar 2006 17:58:46 -0500
xslt grouping unique
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 values.

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 http://www.biglist.com/lists/xsl-list/archives/200401/msg00070.html ... 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

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.