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

RE: removing duplicate children

Subject: RE: removing duplicate children
From: Cliff Draper <Cliff.Draper@xxxxxxx>
Date: Fri, 01 Dec 2000 17:07:39 -0800
duplicate children
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Fri, 1 Dec 2000 11:47:06 -0000 
> > I want to iterate thru a list of nodes that I select and only print
> > out the unique ones.  This is different from what I've seen in the FAQ
> > since I want unique values only from the current node and below it.
> 
> This makes it difficult because neither the preceding nor the
> preceding-sibling axis gives you the right answer. I'd suggest using
> Muenchian grouping with generate-id() of the "owning" node as part of the
> key value. See www.jenitennison.com.
> 
> Mike Kay 

Well, I tried  that, several other permutations, and couldn't get
anywhere.  I did figure out a way to solve the problem though.  I use
my for-each to build up a string which is then passed to a template I
call uniq.  The parameter passed in looks something like:
	 |z|a|b|c|a|b|c|b|b|y|z|
That is, a "string list" with '|' as a separator.  My uniq template
uses the string functions substring-before, substring-after, &
contains to recursively make that into a unique list.

That's a lot of work for such a simple thing (simple in procedural
languages).  But at least I've got something working now.

regards,
Cliff Draper    Sun Microsystems, Forte Tools    (510) 869-3462 or x73462
My opinions may or may not reflect those of my employer.
---------------------------- food for thought ---------------------------
The chief cause of problems is solutions.


 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.