RE: [xsl] Re: A proposal:xsl:result-document asynchronous attribute

Subject: RE: [xsl] Re: A proposal:xsl:result-document asynchronous attribute
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 11 Mar 2003 11:41:26 -0000
> I wonder what we can do about random number generation. 

I think the simplest solution for most use cases involving random
numbers is a function that permutes a supplied sequence into random
order:

To deal a deck of cards:

<xsl:for-each select="random(1 to 52)">
   ...
</xsl:for-each>

To select 1000 people chosen at random:

<xsl:for-each select="subsequence(random(//person), 1, 1000)">
   ...
</xsl:for-each>


Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread