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

RE: New twist: eliminating nodes with duplicate content, cas

Subject: RE: New twist: eliminating nodes with duplicate content, case-ins ensi tive
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 6 Dec 1999 18:08:57 -0000
RE: New twist: eliminating nodes with duplicate content
> My question is really how to eliminate duplicates, counting
>    <handle>FOO</handle>
> and
>    <handle>foo</handle>
> as duplicates.
> 
> I still need an answer, if anyone knows one.
> 
> <xsl:variable "unique-handles" select="//handle[not( self::node() =
> following::handle )]"/>
> 

Can't be done in a single pass. (A brave assertion!) This is because there
is no general existential quantifier in XSLT and no map() function to
generate a set of strings by applying a function (translate()) to another
set of strings. If you apply translate to a node-set, it only translates the
string value of the first node.

Conceptually you need (using SQL-like syntax rather than pure predicate
logic)

select="//handle[not exists( select N from following::handle where
translate(N, $lc, $uc) = 
translate(self::node(), $lc, $uc)]

I suggest you do one pass to normalize case, and a second pass to do the
real transformation.

Mike Kay


 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.