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

RE: "sorted" axis (was: Remove duplicates from a node-set ac

Subject: RE: "sorted" axis (was: Remove duplicates from a node-set accordi ng to content)
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Fri, 30 Jul 1999 15:46:44 +0100
remove duplicates in linear time
> You could do
> 
>(selectively quoted:) 
>
> <xsl:apply-templates mode="sec" 
> select="following-sibling::*[not(@name=$n)][1]"/>
> </xsl:template>
> 
> 
> <xsl:apply-templates 
>    mode="elem"
>   select="following-sibling::*[position()=1 and (@name=$n)]">
>   <xsl:with-param name="t" select="$t+@value"/>
> </xsl:apply-templates>
> <xsl:if test="not(following-sibling::*[position()=1 and (@name=$n)])">
> <total>
> <xsl:value-of select="$t+@value"/>
> </total>

You could indeed. Only two problems: it's murder to write, and it's hard to
optimise the implementation to run in linear time.

The second is perhaps a bad reason for changing the language (SQL users just
had to wait ten years while researchers came up with the optimisation
techniques), but the first is a rather good one.

Mike K


 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.