<xsd:element name="Longitude">
<xsd:annotation>
<xsd:documentation>[E|W]degree.minute.second.f, degree range [0-180], decimal fraction f in arbitrary length (ex. E25.00.00)</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="(\+|-)(\d|\d\d|[0-1][0-7]\d)\.([0-5]\d)((\.[0-5]\d\.\d+)|(\.[0-5]\d))?|180\.00\.00(\.0+)?">
<xsd:annotation>
<xsd:documentation>
Pattern is generally of the form +DDD.MM.SS (D=degrees, M=minutes, S=seconds)
Description of the pattern:
1) '+' or '-' required unless the value is 180.00.00
- if 180.00.00, then omit the '+' or '-'
- '+' means East, '-' means West
2) A one-digit, two-digit, or three-digit number for degrees (range 0 to 179) - required
3) A dot (the decimal between degrees and minutes) - required
4) A two-digit number for minutes (range 00 to 59) - required
5) A dot (the decimal between minutes and seconds) - optional
6) A two-digit number for seconds (range 00 to 59) - optional
- if there is a dot in step 5, then there must be a two-digit number for seconds
7) A dot (the decimal between seconds and parts of a second) - optional
8) Digits for parts of a second (can be any number of digits) - optional
- if there is a dot in step 7, then there must be at least one digit after it
Examples:
+0.00.00
+00.00.00
+000.00.00
180.00.00
180.00.00.0
-179.59.59
-40.59.59.555
-40.59
Pattern breakdown: (D=degrees, M=minutes, S=seconds)
(\+|\-) (...see next line..) | 190\.00\.00(\.0+)? <!-- choice of: +(...DDD.MM.SS pattern...) OR 180.00.00 -->
(\d|\d\d|[0-1][0-7]\d)\.([0-5]\d) (...see next line..) <!-- D (0-9), DD (00-99), DDD (000-179) and MM (00-59) ranges defined, followed by ... -->
((\.[0-5]\d\.\d+) | (\.[0-5]\d))?<!-- SS with decimal fractions of S *OR* SS without fractions of S *OR* no SS at all -->
The original pattern (just for insurance):
pattern value="(E|W)((\d|\d\d|[0-1][0-7]\d)\.([0-5]\d)\.[0-5]\d(\.\d+)?)|180\.00\.00(\.0+)?"
</xsd:documentation>
</xsd:annotation>
</xsd:pattern>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
|