<?xml version="1.0" encoding="UTF-8"?>
<!-- ==================================================================== -->
<!-- Introduction                                                         -->
<!-- ==================================================================== -->
<!-- Schema for a type library for custom Darwin Core data types.         -->
<!-- History:                                                             -->
<!--   version 1.0 2009-08-24 John Wieczorek                              --> 
<!--   version 0.5 2007-02-14 John Wieczorek                              --> 
<!-- Status:                                                              -->
<!--   Ready for use.                                                      -->

<!-- ==================================================================== -->
<!-- Schema                                                               -->
<!-- ==================================================================== -->
<xs:schema 
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="unqualified" version="0.5">

	<!-- ============================================================== -->
	<!-- Types                                                          -->
	<!-- ============================================================== -->
	<xs:simpleType name="nonEmptyString">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="positiveDouble">
	  <xs:restriction base="xs:double">
	    <xs:minExclusive value="0"/>
	  </xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="dayOfYearDataType">
	  <xs:restriction base="xs:integer">
	    <xs:minInclusive value="1"/>
	    <xs:maxInclusive value="366"/>
	  </xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="decimalLatitudeDataType">
	  <xs:restriction base="xs:double">
	    <xs:minInclusive value="-90"/>
	    <xs:maxInclusive value="90"/>
	  </xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="decimalLongitudeDataType">
	  <xs:restriction base="xs:double">
	    <xs:minInclusive value="-180"/>
	    <xs:maxInclusive value="180"/>
	  </xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="spatialFitDataType">
	  <xs:union>
	    <xs:simpleType>
	      <xs:restriction base="xs:double">
		<xs:minInclusive value="0"/>
		<xs:maxInclusive value="0"/>
	      </xs:restriction>
	    </xs:simpleType>
	    <xs:simpleType>
	      <xs:restriction base="xs:double">
		<xs:minInclusive value="1"/>
	      </xs:restriction>
	    </xs:simpleType>
	    <xs:simpleType>
	      <xs:restriction base="xs:NMTOKEN">
		<xs:enumeration value="undefined"/>
	      </xs:restriction>
	    </xs:simpleType>
	  </xs:union>
	</xs:simpleType>

        <xs:simpleType name="dateTimeISO">
          <xs:annotation>
            <xs:documentation xml:lang="en">
              The date and time expressed in a way conforming to a subset of ISO 8601. Meant to be exactly the same as DateTimeISO defined in ABCD.
            </xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:string">
            <xs:pattern value="\d\d\d\d(\-(0[1-9]|1[012])(\-((0[1-9])|1\d|2\d|3[01])(T(0\d|1\d|2[0-3])(:[0-5]\d){0,2})?)?)?|\-\-(0[1-9]|1[012])(\-(0[1-9]|1\d|2\d|3[01]))?|\-\-\-(0[1-9]|1\d|2\d|3[01])">
            </xs:pattern>
          </xs:restriction>
       </xs:simpleType>

</xs:schema>
