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

Re: HST's answers Re: Efficient way to check se

Subject: Re: HST's answers Re: Efficient way to check sequence membership -
From: Dave Pawson <davep@xxxxxxxxxxxxx>
Date: Thu, 3 Mar 2011 07:50:38 +0000
Re:  HST's answers Re:  Efficient way to check  se
On Thu, 03 Mar 2011 00:06:43 +0000
Michael Kay <mike@xxxxxxxxxxxx> wrote:

> On 02/03/2011 22:00, Henry S. Thompson wrote:
> > I've thought of five ways to do this:
> >
> >   1) tokenise and use "some ...", as in the previous message;
> >   2) Add '|' at the beginning of both $stopPat and the word to be
> >      checked, and use contains;
> >   3) Put a sequence of elements with a 'w' attribute whose value is
> > a stop in $stops, then do boolean($stops/*[@w=$w]);
> >   4) As above, but then define an appropriate key and use
> >       boolean($stops/key('stop',$w));
> >   5) Build a regexp and use match:
> >       concat('^(',$stopPat,')$')
> >
> Your results don't surprise me. For all except (4), the naive 
> implementation is O(n) whereas for (4) it is O(n log n). Now we don't 
> know what n is, but if it's large enough then O(n log n) will always 
> win. The fact that the different O(n) solutions have different 
> multiplying factors is always worth remembering, of course.


Does xslt version next have the member() function Mike?
All these node functions, member seems a fairly obvious one?



-- 

regards 

-- 
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.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.