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

Re: Problems calculating the running time of an xsl s

Subject: Re: Problems calculating the running time of an xsl script
From: Michael Ludwig <milu71@xxxxxx>
Date: Thu, 10 Dec 2009 14:14:48 +0100
Re:  Problems calculating the running time of an xsl  s
Alex Muir schrieb am 10.12.2009 um 13:03:14 (+0000):

> On each XSL files I'm setting a global variable to store the current
> date time.
> 
> <xsl:variable name="startExecutionTime" as="xs:dateTime">
>     <xsl:value-of select="current-dateTime()"/>
>   </xsl:variable>

Could be written more concisely as:

  <xsl:variable name="startExecutionTime"
    select="current-dateTime()" as="xs:dateTime" />

> And then have a template that in theory might execute last as it
> appends content to the end of the xml file which calls a template in
> an included file

XSLT deals with trees, not with files. So there is no "appending".
Conceptually, XSLT processing does not happen sequentially, but all in
once. The order of execution is up to the XSLT processor, which may
choose to optimize one way or the other.

> Problem is that the startExecutionTime and the CurrentExecutionTime
> are always the same resulting in zero duration

The expression is evaluated only once. What you get is the time at
invocation.

> I'm thinking to pass the time in as a parameter from xproc on my next
> attempt at this.

The time passed in would be moreless the same as from within the XSLT
processor, wouldn't it?

> Is there a way to calculate the running time of an xsl script within
> the script?

Take a timestamp before execution, and another after execution.

-- 
Michael Ludwig

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.