[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: current-dateTime()

Subject: Re: current-dateTime()
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Sat, 19 Apr 2008 10:39:45 +0100
Re:  current-dateTime()
On 19/04/2008, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> > It would be really useful if it returned the actual dateTime
>  > at the time of the call so you could implement a progress
>  > reporting feature in the transform - you could say how many
>  > records were processed in a given time and based on that
>  > suggest when the transform might finish.
>
>
> It wouldn't be as useful as you think. Let's say you use an extension
>  function that does this, as has been suggested:
>
>  <xsl:variable name="startTime" select="xx:current-dateTime()"/>
>  ... do some processing ...
>  <xsl:variable name="endTime" select="xx:current-dateTime()"/>
>  <xsl:message select="$endTime - $startTime"/>
>
>  The final result will be a negative duration, because Saxon will evaluate
>  $endTime before it evaluates $startTime.

ha, good point - that should be the #1 example for describing what
lazy evaluation is...

It is easy enough though to ensure startTime is evaluated at the start
of processing.


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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.