XML technologies / XML Schema / Data type reference / xs:gYearMonth

(Excerpt from “XML Schema” by Eric van der Vlist)

A one-month period

Derived from: xs:anySimpleType

Primitive type: xs:gYearMonth

Known subtypes: none

Facets: xs:enumeration, xs:maxExclusive, xs:maxInclusive, xs:minExclusive, xs:minInclusive, xs:pattern, xs:whiteSpace

Definition

<xs:simpleType name="gYearMonth" id="gYearMonth">
    <xs:restriction base="xs:anySimpleType">
        <xs:whiteSpace value="collapse" fixed="true"/>
    </xs:restriction>
</xs:simpleType>

Description

The value space of xs:gYearMonth consists of calendar-month periods, such as February 2003. The lexical space follows ISO 8601 notation for these periods, YYYY-MM, with an optional time zone.

Restrictions

The duration, one month, is fixed, and no calendars other than Gregorian are supported.

Example

Valid values include "2001-10", "2001-10+02:00", "2001-10Z", "2001-10+00:00", "-2001-10" or "-20000-04".

Invalid values would include "2001" (missing month), "2001-13" (month out of range), "2001-13-26+02:00" (month out of range) or "01-10" (missing century).

   

 

 

 

back to top