[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
> 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
|
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
|