Re: [xsl] current-dateTime()

Subject: Re: [xsl] current-dateTime()
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 18 Apr 2008 16:08:14 +0100
On 18/04/2008, Liam Quin <liam@xxxxxx> wrote:
> On Fri, Apr 18, 2008 at 02:05:52PM +0100, Andrew Welch wrote:
>  > It should be straightforward to write an extension function instead...
>
>
> Actually no.  A conformant implementation is allowed to call an
>  extension function only once for any given argument value, and
>  to remember the results, to make it stable.  A give implementation
>  might let you write such an extension function as you want, but
>  there's no guarantee.
>
>  In addition, suppose you have a stylesheet that does, say
>
>     xsl:for-each 1 to 1000
>         value-of current-time
>
>  the implementation doesn't have to start at 1 and evaluate the
>  "loop"  a thousand times.  Instead, this could be written as,
>     map the items in the sequence (1 ... 1000)
>     to the value of current-time
>  with current-time being called once.
>
>  Or, the implementation could start at 1000 and work downwards,
>  and as long as it ended at 1 and put the results in the right
>  order, you coudn't tell.

Sure, but below the XSLT level there is the concept of time per
mapping so if you can call out to that level you should be able to
output some reasonable progress messages - this is helpful in the
context of a standalone transform controlling the overall process as
opposed to some host language controlling the transform (where there
would be other ways of indicating progress).

Current Thread