[Bug 4844] [FO] random() function

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4844





------- Comment #3 from mike@saxonica.com  2008-01-18 20:59 -------
It's worth noting that EXSLT provides a random-sequence() function:

http://www.exslt.org/random/functions/random-sequence/index.html

This returns a sequence (of specified length) containing random numbers between
zero and 1.

This serves a number of use cases that XSLT users have found useful, for
example generating test data. It's probably more general that the requested
function to produce a random permutation of a given input sequence; in fact it
could be used to underpin the requested function by writing

let $random := random:random-sequence(count($input))
for $item at $p in $inputSequence
order by $random[$p]
return $item

Received on Friday, 18 January 2008 20:59:45 UTC