[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Random number seed generation
I see some possibilities like passing seed as parameter to templates or within the data, which is at least partly regenerated each generation in the evolution steps. Most code is/will be recursive. Michel On Thu, Dec 9, 2010 at 4:37 PM, Michael Kay <mike@xxxxxxxxxxxx> wrote: > On 09/12/2010 14:04, Michel Hendriksen wrote: >> >> Hi all, >> >> I'm using Saxon9he processor XSLT 2.0, and I am trying to get some >> random numbers. I'm currently using fxsl/random for this. The problem >> is that it needs a seed. >> I tried using current time stuff but that doesn't change during the >> transfomation using the stylesheet.. So I tried an extension function >> to cal to Java but that doesn't seem to work. Examples are probably >> XSLT 1.0 but should be ok. >> > > You need to organize your code so that all the random numbers come from a > single sequence from a single seed; or alternatively, generate one random > sequence and use the numbers from this as seeds for subsidiary random > sequences. > > Can't tell you how to do that without knowing more about your code. It can > be tricky - it may involve turning iterative code into recursive code. > > Michael Kay > Saxonica
|
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
|