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

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

A one-year period

Derived from: xs:anySimpleType

Primitive type: xs:gYear

Known subtypes: none

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

Definition

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

Description

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

Restrictions

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

Example

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

The following values would be invalid: "01" (the century part is missing) or "2001-12" (month parts are forbidden).

   

 

 

 

back to top