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

RE: [sly] Minimum value

Subject: RE: [sly] Minimum value
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 20 Sep 2002 22:03:54 -0700 (PDT)
xpath minimum
--- "Avula, Raj" <RAvula at firstam dot com> wrote:

> That's really great! 
> I was really thinking of writing recursive templates to this.
> 
> 
> Thanks,
> Raja..
> 
> 
> -----Original Message-----
> From: Marrow [mailto:marrow@xxxxxxxxxxxxxx]
> Sent: Friday, September 20, 2002 2:17 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Minimum value
> 
> 
> Hi,
> 
> Try...
> 
>   <xsl:value-of select="//value[not(. &gt; //value)]"/>
> 
> (replace the // with the full path as required)


Yes, it is great that XPath has the power to specify the minimum of a
node-set just in one expression.

However, this often comes at a price. In this case the time complexity
(speed-related) is O(n^2), which is better not used in
industrial-strength applications.

You can use a generic "minimum" template from the FXSL library (O(n)),
or you can code your own recursive named template with the same linear
complexity.

The FXSL "minimum" template allows a "less-than" function to be passed
as a parameter, thus it implements finding the minimum over any set
that has an ordering relation "<=".



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

 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.