Re: New twist: eliminating nodes with duplicate content, cas
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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format