XPath/XQuery add-yearMonthDurations function

Summary

Returns the result of adding two xs:yearMonthDuration values.

Operator Mapping

Defines the semantics of the "+" operator when applied to two xs:yearMonthDuration values.

Signature

op:add-yearMonthDurations(
$arg1 as xs:yearMonthDuration,
$arg2 as xs:yearMonthDuration
) as xs:yearMonthDuration

Rules

The function returns the result of adding the value of $arg1 to the value of $arg2. The result will be an xs:yearMonthDuration whose length in months is equal to the length in months of $arg1 plus the length in months of $arg2.

For handling of overflow, see .

Examples

The expression op:add-yearMonthDurations(xs:yearMonthDuration("P2Y11M"), xs:yearMonthDuration("P3Y3M")) returns xs:yearMonthDuration("P6Y2M").

Notes

Either duration (and therefore the result) may be negative.