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(_at_)saxonica(_dot_)com>
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
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--