Name

xsd:gMonth — Recurring period of time: yearly month

Synopsis

<xsd:simpleType name="gMonth” id="gMonth">
 <xsd:restriction base="xsd:anySimpleType">
 <xsd:whiteSpace value="collapse” fixed="true"/>
 </xsd:restriction>
</xsd:simpleType>

Derived from

xsd:anySimpleType

Primary

xsd:gMonth

Known subtypes

None

Data parameters (facets)

enumeration, maxExclusive, maxInclusive, minExclusive, minInclusive, pattern

Description

The value space of xsd:gMonth is the period of one calendar month recurring each calendar year (such as the month of April). Its lexical space should follow the ISO 8601 syntax for such periods (i.e., -- MM) with an optional time zone.

Tip

There’s a typo in the W3C XML Schema Recommendation, in which the format is defined as -- MM -- --. Even though an erratum should be published to bring the W3C XML Schema inline with ISO 8601, most current schema processors expect the (bogus) -- MM -- -- format.

In the example, I follow the correct ISO 8601 format.

Restrictions

The period (one year) and the duration (one month) are fixed, and no calendars other than Gregorian are supported.

Because of the typo in the W3C XML Schema Specification, you must choose between a bogus format, which works on the current version of the tools, or a correct format, which conforms to ISO 8601.

Example

Valid values include --05, --11Z, --11+02:00, --11-04:00, and --02.

The following values are invalid: -01- (the format must be --MM), --13 (the month is out of range), --1 (both digits must be provided), or ...

Get RELAX NG now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.