|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Seed problem in FXSL randomizeList
Thanks for the hint Michael.
I now do this for the first seed:
xs:integer(format-time(current-time(), '[s][f]'))
The sequence of positions returned is then kept in a variable x like this:
<xsl:variable name="x">
<xsl:call-template name="randomizeList">
<xsl:with-param name="pList" select="(1 to count(/items/item))[. != $num]"/>
<xsl:with-param name="pSeed" select="$pSeed" as="xs:integer"/>
</xsl:call-template>
</xsl:variable>
The second seed is then generated like this:
xs:integer(substring(string-join($x/el[position() < 6], ''), 1, 4))
Etc, and again for the third seed, etc, and it looks like it works well.
I'm now more confident that the pseudo-randomization is random!
Cheers,
Jesper
http://www.xmlplease.com
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








