Please enable JavaScript to view this site.

Altova MapForce 2021 Basic Edition

Returns an xs:integer representing the "days" component of the canonical representation of the duration value supplied as argument.

 

Languages

XQuery, XSLT 2.0.

 

Parameters

Name

Type

Description

duration

xs:duration

The input value of type xs:duration.

 

Example

The mapping illustrated below constructs the xs:dayTimeDuration of P2DT1H (2 days and 1 hours) and supplies it as input to the days-from-duration function. The result is 2.

mf-func-xpath2-day-from-duration-example

XSLT 2.0 mapping

Note:If the duration is P1DT24H (1 day and 24 hours), the function returns 2, not 1. This is because the canonical representation of P1DT24H is actually P2D (2 days).

© 2020 Altova GmbH