Description
The functx:total-days-from-duration function returns the total number of days in $duration . If it is an uneven number of days, it will return a fractional part. This function is different from the built-in fn:days-from-duration function because the latter will not return a fractional part. If $duration is the empty sequence, the empty sequence is returned.
Arguments and Return TypeName | Type | Description |
$duration |
xs:dayTimeDuration? |
the duration |
return value |
xs:decimal? |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:total-days-from-duration" as="xs:decimal?"
xmlns:functx="http://www.functx.com">
<xsl:param name="duration" as="xs:dayTimeDuration?"/>
<xsl:sequence select="
$duration div xs:dayTimeDuration('P1D')
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:total-days-from-duration(
xs:dayTimeDuration('PT24H')) |
1 |
functx:total-days-from-duration(
xs:dayTimeDuration('P1D')) |
1 |
functx:total-days-from-duration(
xs:dayTimeDuration('PT36H')) |
1.5 |
functx:total-days-from-duration(
xs:dayTimeDuration('PT48H')) |
2 |
See AlsoHistory |
Recommended Reading:
|