W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2008

[Bug 4844] [FO] random() function

From: <bugzilla@wiggum.w3.org>
Date: Fri, 18 Jan 2008 20:59:37 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1JFyJN-0002n5-Cp@wiggum.w3.org>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:49 GMT