Subject: Re: [xsl] Calling mutator java method (date fields to seconds-since-epoch with java.util.GregorianCalendar) From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 22 Aug 2006 12:44:58 +0100 |
> But if I had the duration, how would I convert it into the number of > seconds? something like: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:param name="date"/> <!--1999-12-31T12:00:00"--> <xsl:template name="main"> <xsl:value-of select=" for $d in xs:dayTimeDuration(xs:dateTime($date) - xs:dateTime('1970-01-01T00:00:00')) return days-from-duration($d)*24*60*60 + hours-from-duration($d)*60*60 + minutes-from-duration($d)*60 + seconds-from-duration($d)"/> </xsl:template> </xsl:stylesheet> saxon8 -it main dates.xsl date=1999-12-31T12:00:01 <?xml version="1.0" encoding="UTF-8"?>946641601
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Calling mutator java meth, Tim Lebo | Thread | RE: [xsl] Calling mutator java meth, Michael Kay |
Re: [xsl] Calling mutator java meth, Tim Lebo | Date | Re: [xsl] recursive template call, , Sam Carleton |
Month |