XPath/XQuery gYearMonth-equal function

Summary

Returns true if the two xs:gYearMonth values have the same starting instant.

Operator Mapping

Defines the semantics of the "eq" operator when applied to two xs:gYearMonth values. Also used in the definition of the "ne" operator.

Signature

op:gYearMonth-equal(
$arg1 as xs:gYearMonth,
$arg2 as xs:gYearMonth
) as xs:boolean

Properties

This function is deterministic, context-dependent, and focus-independent. It depends on implicit-timezone.

Rules

The starting instants of $arg1 and $arg2 are calculated by supplying the missing components of $arg1 and $arg2 from the xs:dateTime template xxxx-xx-01T00:00:00. The function returns the result of comparing these two starting instants using op:dateTime-equal.

Examples

Assume that the dynamic context provides an implicit timezone value of -05:00.

op:gYearMonth-equal(xs:gYearMonth("1986-02"), xs:gYearMonth("1986-03")) returns false(). The starting instants are 1986-02-01T00:00:00-05:00 and 1986-03-01T00:00:00, respectively.

op:gYearMonth-equal(xs:gYearMonth("1978-03"), xs:gYearMonth("1986-03Z")) returns false(). The starting instants are 1978-03-01T00:00:00-05:00 and 1986-03-01T00:00:00Z, respectively.