[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-insensitive
From: "Clark C. Evans" <clark.evans@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 3 Dec 1999 02:55:56 -0500 (EST)
duplicate content xsl
Jermey,

  Use the translate function:  translate(source,'ABC...Z','abc...z')

Clark

On Fri, 3 Dec 1999, Richman, Jeremy wrote:

> Date: Fri, 3 Dec 1999 14:27:30 -0500
> From: "Richman, Jeremy" <jrichman@xxxxxxxxxxxx>
> Reply-To: xsl-list@xxxxxxxxxxxxxxxx
> To: 'xsl-list' <XSL-List@xxxxxxxxxxxxxxxx>
> Subject: New twist: eliminating nodes with duplicate content,
     case-insensi tive
> 
> I want to create a node set of all nodes of a certain type, eliminating
> duplicates using
> case-insensitivity, then convert all notes to lower case.
> 
> If I have this xml:
> 
> <handle-list>
>   <handle>RED DOG</handle>
>   <handle>Red Dog</handle>
>   <handle>Goldfish</handle>
> </handle-list>
> 
> And I'd like to generate just:
> 
> <handle-list>
>    <handle>goldfish</handle>
>    <handle>red dog</handle>
> <handle-list>
> 
> How can I do this?  I realize the translate function must be used to change
> from upper to lower.
> But the only function I have to eliminate duplicates is case sensitive, e.g.
> 
> <xsl:variable "unique-handles" select="//handle[not( self::node() =
> following::handle )]"/>
> 
> If use then process the nodes in unique-handles, I'll get a nodeset that
> includes all of the original handle elements,
> instead of just two.
> 
> I could possibly create a pretty complicated looping construct of several
> templates, that for each node in the
> $unique-handles nodeset, iterates over the following nodes in the set, using
> translate to look for duplicates.
> 
> Any ideas?
> 
> Jeremy Richman
> 
> 
> 
>  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.