[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] exslt random:random-sequence() and Math:random()


Subject: Re: [xsl] exslt random:random-sequence() and Math:random()
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Thu, 18 Mar 2010 13:17:56 +0100

Mike Odling-Smee wrote:
Calling "impure" functions in XSLT is always problematic; the more
aggressive your optimizer, the more problematic it becomes.

Michael - I have noticed that calling the function current-dateTime() multiple-times within one XSLT invocation seems to always give the same result even if a significant amount of time has elapsed - is this for the same reason? If so there anyway to fool the optimiser? (In this example I was usingSaxon 9.1.0.8).

I don't think it is any optimization causing that, the function
http://www.w3.org/TR/xpath-functions/#func-current-dateTime
is supposed to return "the current dateTime ... from the dynamic context". And the XSLT 2.0 spec clearly says:
"The current date and time represents an implementation-dependent point in time during processing of the transformation; it does not change during the course of the transformation."


--

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/


Current Thread
Keywords