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

Re: [xsl] current-dateTime()


Subject: Re: [xsl] current-dateTime()
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 18 Apr 2008 14:05:52 +0100

On 18/04/2008, John Snelson <john.snelson@xxxxxxxxxx> wrote:
>  XPath 2.0 and XSLT 2.0 are declarative languages that have no conventional
> notion of instruction order, and therefore have no internal notion of time
> passing. An optimizer is free to do any number of things with your
> stylesheet, including parallelize it across multiple machines, and reorder
> it any number of different ways. When these things are going on, the idea of
> outputting the time between two events happening has very little meaning.

Sure - I understand there's no concept of time in the evaluation of a
transform but there certainly is for me sat in my chair waiting for it
to finish :)

I often do:

<xsl:if test="position() mod 1000 eq 0">
  <xsl:message select="concat('Processed ', position(), '/', $total')"/>

to output:

Processed 1000/1000000
Processed 2000/1000000
...

which is good enough to show something is happening but it would've
been nicer to also show an estimated finish time based on progress so
far.

I wrongly thought that the "implementation dependent" part meant the
processor could return different values for multiple calls to
current-dateTime()... instead of merely the freedom to choose the
instant at which it takes the fixed value.

It should be straightforward to write an extension function instead...

-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/


Current Thread
Keywords