A datatype of angleType will have (up to) three subelements, representing the degrees, minutes, and seconds, and an attribute representing the hemisphere.
This datatype was developed to support the Epicentre angle data types. Its intended usage is shown in the PEF angle element document. However, it is clearly useful as a datatype in its own right. Its usage is shown below in the sample usage schema and sample XML.
Note that an angle can be formatted as above, with the degree, minute, second (dms) concept, or as a quantity value. This data type is intended to support the dms concept, and explicitly parses the dms into its parts. A general angle to support other formats can be a choice of the dms, the quantity, or a text field.
<xsd:simpleType name="degval">
<xsd:restriction base="xsd:nonNegativeInteger">
<xsd:maxInclusive value="180"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="angleType">
<xsd:sequence>
<xsd:element name="degree">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="degval">
<xsd:attribute name="direction">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="N"/>
<xsd:enumeration value="E"/>
<xsd:enumeration value="S"/>
<xsd:enumeration value="W"/>
<xsd:enumeration value="+"/>
<xsd:enumeration value="-"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="minute" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:nonNegativeInteger">
<xsd:maxExclusive value="60"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="second" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:decimal">
<xsd:minInclusive value="0.0"/>
<xsd:maxInclusive value="60.0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="latitude" type="angleType"/>
<xsd:element name="longitude">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="dms" type="angleType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<latitude>
<degree direction="N">42</degree>
<minute>22</minute>
<second>49.23</second>
</latitude>
<longitude>
<dms>
<degree direction="+">9</degree>
<minute>14</minute>
<second>12.84</second>
</dms>
</longitude>