xsl-list
[Top] [All Lists]

RE: [xsl] Performance Loss by dateTime conversion?

2007-03-16 16:43:32

I have a performance issue concerning the conversion from C's 
time_t (seconds since 00:00:00 GMT Jan. 1,
1970) to a date time string like CCYYMMDDHHMMSS.

I use EXSLT's Date library (add, duration, ...) to do this 
conversion. It works, but the performance is very poor (e.g.: 
22 minutes for 3200 records).

XSLT is generated by Altova MapForce. 

Try either or both of:

(a) code it in XSLT 2.0

<xsl:variable name="epoch" select="xs:dateTime('1970-01-01T00:00:00Z')"/>
<xsl:variable name="milli" select="xs:dayTimeDuration('PT0.001S')"/>
<xsl:for-each ...
  <xsl:value-of select="format-dateTime(
     $epoch + $timestamp * $milli,
     '[Y0001][M01][D01][H01][M01][S01]')"/>

(b) run it with Saxon 8.9

My guess is if you do both then it will run in a few seconds.

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>