xsl-list
[Top] [All Lists]

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

2014-05-07 12:37:17
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, …).
- http://learnyouahaskell.com/input-and-output#randomness
-
https://www.fpcomplete.com/school/starting-with-haskell/libraries-and-frameworks/randoms
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>