xsl-list
[Top] [All Lists]

Re: [xsl] current-dateTime()

2008-04-18 06:06:18
On 18/04/2008, John Snelson <john(_dot_)snelson(_at_)oracle(_dot_)com> 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/

--~------------------------------------------------------------------
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>