Adds $yearMonthDuration-var1 to $yearMonthDuration-var2.
op:add-yearMonthDurations(xf:yearMonthDuration $yearMonthDuration-var1, xf:yearMonthDuration $yearMonthDuration-var2) —> xf:yearMonthDuration
Returns the yearMonthDuration value of adding $yearMonthDuration-var1 to $yearMonthDuration-var2.
The following example query adds a yearMonthDuration value equal to 1 year and 2 months to a yearMonthDuration value equal to 2 years and 11 months as shown in the following query:
<yearMonthDuration>{ op:add-yearMonthDurations(xf:yearMonthDuration("P1Y2M"), xf:yearMonthDuration("P2Y11M")) }</yearMonthDuration>
The resulting yearMonthDuration value of 4 years and 1 month is returned as shown in the following result:
<yearMonthDuration>P4Y1M</yearMonthDuration>
W3C add-yearMonthDurations operator description.
W3C yearMonthDuration description.
xf:yearMonthDuration constructor description.