xsl-list
[Top] [All Lists]

RE: Better include them in the XSLT 2.0 spec (Was: Re: [xsl] Time for an exslt for 2.0?)

2005-05-12 16:06:14
Is there some other mechanism which would be used to,
for example, return a random number, other than a function?

There are various ways of designing functions to generate a (pseudo-)random
number sequence:

(a) a function that returns a sequence of random numbers (rather than just
one)

(b) a function that takes one number as input and generates a new number
from it

Having a function with no arguments that returns a different number each
time it's called is not a good design, because the optimizer is likely to
move it out of the processing loop. (This is also a danger with
node-creative functions, of course; but an optimizer can be expected to
analyze the function body to determine whether a function is node-creative
or not.)

Michael Kay
http://www.saxonica.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>
--~--



<Prev in Thread] Current Thread [Next in Thread>