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

Re: shuffling words in text content

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

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.