xsl-list
[Top] [All Lists]

RE: [xsl] Getting the length of a duration

2007-12-31 18:01:34

Have I missed an obvious better way to write this function?

Yes (Happy New Year).

$duration div xs:dayTimeDuration('PT1S')

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

-----Original Message-----
From: Deborah Pickett [mailto:debbiep-list-xsl(_at_)futzle(_dot_)com] 
Sent: 01 January 2008 00:25
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Getting the length of a duration

Have I missed an obvious better way to write this function?

    <xsl:function name="xmltv2tgd:durationLength" as="xs:decimal">
        <xsl:param name="duration" as="xs:dayTimeDuration"/>
        <xsl:sequence select="days-from-duration($duration) * 86400
            + hours-from-duration($duration) * 3600
            + minutes-from-duration($duration) * 60
            + seconds-from-duration($duration)"/>
    </xsl:function>


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



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