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

Re: Tokenize followed by compare or satisfies using c

Subject: Re: Tokenize followed by compare or satisfies using contains()?
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 2 Sep 2016 21:47:48 -0000
Re:  Tokenize followed by compare or satisfies using  c
On Fri, Sep 02, 2016 at 09:38:07PM -0000, Eliot Kimber ekimber@xxxxxxxxxxxx scripsit:
> In the specific DITA case you're searching for strings reliably bound by
> blanks, so the contains is correct in this case.
> 
> Your statement "Intrinsically, tokenizing is more complex than just
> searching for a substring." is I think what I was looking for--that
> suggests that as a general policy that preferring contains() over tokenize
> and sequence comparison will be the better choice if performance is the
> only concern (and assuming that it actually produces a meaningful
> performance difference, which it very well may not).

If you're seriously concerned about performance, generate a list of the
known @class values, stick it in an XML structure in a variable,
and use key() to look stuff up in it.  That risks requiring regularizing
the @class spaces first but it also means you only have to worry about
decomposing the @class when it's an unknown value and the fallback is
required.

-- Graydon

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.