[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xquery-talk] [xsl] Re: Random number generation : requirements


Subject: Re: [xquery-talk] [xsl] Re: Random number generation : requirements
From: "Olivier JEULIN olivier.jeulin@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 7 May 2014 17:37:04 -0000

HI,


One use case we had during testing was to select random nodes:
<xsl:variable name="num" select="test:random(count($ur)) + 1"/>
<xsl:apply-templates mode="title-test" select="($ur)[position() = $num]">

If you haven't done so yet, I suggest you have a look at the way Haskell
handles randomness and the different the type of data (integer, boolean,
b&).
- http://learnyouahaskell.com/input-and-output#randomness
-
https://www.fpcomplete.com/school/starting-with-haskell/libraries-and-framewo
rks/randoms


Current Thread