"James Cummings" <James(_dot_)Cummings(_at_)ota(_dot_)ahds(_dot_)ac(_dot_)uk>
wrote in message
news:Pine(_dot_)LNX(_dot_)4(_dot_)58(_dot_)0402061738540(_dot_)17676(_at_)crow(_dot_)linux(_dot_)ox(_dot_)ac(_dot_)uk(_dot_)(_dot_)(_dot_)
Thanks to both Dimitre and David for the XSLT1 and XSLT2
solutions. I've fiddled with both to do a variety of
orders and all seems to be smashingly wonderful.
I haven't yet tested them on huge texts or anything, will
be interesting to compare the speeds. (Though maybe I'll
only want to retrieve the first 30% of results in that
case... there'll be lots of single uses at the bottom.)
I'll see what other nifty things I can think of to do!
Mucho gratias,
-James
James,
To achieve best performance with the FXSL solution, make the following
changes to the "strSplit-to-Words.xsl" template:
1. Change the xsl:import instruction to:
<xsl:import href="dvc-str-foldl.xsl"/>
2. Change this line:
<xsl:call-template name="str-foldl">
to this:
<xsl:call-template name="dvc-str-foldl">
This changed solution is essentially the same but it will use the DVC
(Divide and Conquer) version of str-foldl, and this can process huge strings
without stack-overflow.
Cheers,
Dimitre Novatchev,
FXSL developer,
http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list