Subject: Re: New twist: eliminating nodes with duplicate content, case-insensi tive From: "Clark C. Evans" <clark.evans@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 3 Dec 1999 02:55:56 -0500 (EST) |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
New twist: eliminating nodes with d, Richman, Jeremy | Thread | xsl:attribute question, Clay_Rowland |
FYI: YML: A Grand Unification of SA, Clark C. Evans | Date | Re: support for namespace axis?, David Carlisle |
Month |