xsl-list
[Top] [All Lists]

Re: [xsl] Tokenize followed by compare or satisfies using contains()?

2016-09-02 16:48:02
On Fri, Sep 02, 2016 at 09:38:07PM -0000, Eliot Kimber 
ekimber(_at_)contrext(_dot_)com 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
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>