xsl-list
[Top] [All Lists]

RE: [xsl] current-dateTime()

2008-04-19 01:51:57
On 4/19/08, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:
<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.

If that's the case, then we can strip the - sign if it's 
present or do something like abs() :)

That doesn't help. The real point is that variables aren't evaluated until
they are used, so both startTime and endTime are evaluated after doing all
the work, giving you no useful information about how long it took to do the
work.

Michael Kay
http://www.saxonica.com/


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