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

Re: XSLT 2.0 function - fastest node comparison

Subject: Re: XSLT 2.0 function - fastest node comparison
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 10 Mar 2005 14:05:25 GMT
xslt 2.0 boolean
you never need to write

 if (something) then true() else false()

you could just use 

  something

which must work the same way in a boolean context , as otherwise the
if() test wouldn't have worked.

If you want to force it to be boolean you coul do

boolean(something)

although boolean is slightly different from the efective boolean value
(unless things have changed again) I'll get that wrong unless I checked
it up again so Michael might pick this comment up...

I doubt that makes any difference at all to the efficiency though (it
might make no difference to the compiled code for all I know)

If your ranges are just general ranges I suspect that your actual test is
the best that could be done. If your ranges are a non-overlapping
monotonically increasing sequence of ranges, and you had enough of them
that optimising this was worth it,  there is probably some other
data structure you could use that would tell the system that the
sequence  was monotonicly increasing so it could stop and return false
once it had "gone past" the char. Nothing springs to mind immediately.

so with your example posted given an input of 5 I would guess that you
can return false immediately (or at least after seeing the first range
starts at 988) but your suggested code will check all the ranges.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.