<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

<xsd:element name="DateTimeTests">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element ref="dateRanged"       minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element ref="timeRanged"       minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element ref="dateTimeRanged"   minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element ref="durationRanged"   minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element ref="gdayRanged"       minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element ref="gmonthRanged"     minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element ref="gyearRanged"      minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element ref="gyearmonthRanged" minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element ref="gmonthdayRanged"  minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>

<xsd:element name="dateTimeRanged">
  <xsd:simpleType>
    <xsd:restriction base="xsd:dateTime">
      <xsd:minInclusive value="2006-03-01T00:00:00"/>
      <xsd:maxInclusive value="2006-06-30T23:59:59"/>
      <xsd:pattern value=".*23.*"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>

<xsd:element name="dateRanged">
  <xsd:simpleType>
    <xsd:restriction base="xsd:date">
      <xsd:minInclusive value="2006-03-01"/>
      <xsd:maxInclusive value="2006-06-30"/>
      <xsd:whiteSpace value="collapse"/>
      <xsd:pattern value=".*04.*"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>

<xsd:element name="timeRanged">
  <xsd:simpleType>
    <xsd:restriction base="xsd:time">
      <xsd:minInclusive value="07:01:01.999"/>
      <xsd:maxInclusive value="17:59:59.999"/>
      <xsd:pattern value=".*9.*"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>

<xsd:element name="durationRanged">
  <xsd:simpleType>
    <xsd:restriction base="xsd:duration">
      <xsd:minInclusive value="P5DT20S"/>
      <xsd:maxInclusive value="P200DT20S"/>
      <xsd:pattern value=".*20S.*"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>

<xsd:element name="gdayRanged">
  <xsd:simpleType>
    <xsd:restriction base="xsd:gDay">
      <xsd:minInclusive value="---04"/>
      <xsd:maxInclusive value="---24"/>
      <xsd:pattern value="---.4"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>

<xsd:element name="gmonthRanged">
  <xsd:simpleType>
    <xsd:restriction base="xsd:gMonth">
      <xsd:minInclusive value="--04--"/>
      <xsd:maxInclusive value="--12--"/>
      <xsd:pattern value="--.*1.*"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>

<xsd:element name="gyearRanged">
  <xsd:simpleType>
    <xsd:restriction base="xsd:gYear">
      <xsd:minInclusive value="1965"/>
      <xsd:maxInclusive value="2065"/>
      <xsd:pattern value=".*9.*"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>

<xsd:element name="gmonthdayRanged">
  <xsd:simpleType>
    <xsd:restriction base="xsd:gMonthDay">
      <xsd:minInclusive value="--04-01"/>
      <xsd:maxInclusive value="--12-31"/>
      <xsd:pattern value="--.*9.*"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>

<xsd:element name="gyearmonthRanged">
  <xsd:simpleType>
    <xsd:restriction base="xsd:gYearMonth">
      <xsd:minInclusive value="1965-01"/>
      <xsd:maxInclusive value="2065-12"/>
      <xsd:pattern value=".*9.*"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>

</xsd:schema>
