Re: [xsl] shuffling words in text content

Subject: Re: [xsl] shuffling words in text content
From: "Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 7 Sep 2021 19:54:53 -0000
Hi Michael,

Thanks for having a look!

Originally I tried to use random-number-generator()?permute(), but the XSLT
Fiddle I worked in uses Saxon 9.8 HE and I found that
random-number-generator() isn't supported in Saxon HE until 10+.  :(

Also, originally I used tokenize() and string-join(), but then I switched to
<analyze-string> because (1) it kept newlines/indenting intact in multi-line
strings, and (2) it kept non-word punctuation in place by construction. I
could still use tokenize() to obtain the words, but then I'd need to keep a
"not-a-word" pattern consistent with my "is-a-word" pattern. It made me
happier to keep code symmetry across word acquisition and word substitution.

 - Chris

Current Thread