Extracts the number of months from the months component of $yearMonthDuration-var.
If the value of $yearMonthDuration-var is the empty sequence, the empty sequence is returned. The empty sequence is a sequence containing zero items (), which is similar to null in SQL.
xf:get-months-from-yearMonthDuration(xf:yearMonthDuration? $yearMonthDuration-var) —> xs:integer?
Contains a representation of a time duration which can contain years and months. |
Returns the number of months as an integer from months component of $yearMonthDuration-var.
<months>{xf:get-months-from-yearMonthDuration(xf:yearMonthDuration("P2Y10M"))}</months>
The preceding query generates the following result:
<months>10</months>
<months>{xf:get-months-from-yearMonthDuration(xf:yearMonthDuration("-P5M"))}</months>
The preceding query generates the following result:
<months>-5</months>
W3C get-months-from-yearMonthDuration function description.
W3C yearMonthDuration data type description.