<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Gil Ross (Met Office) -->
<xs:schema targetNamespace="http://www.wmo.ch/web/www/metadata" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xi="http://www.w3.org/2003/XInclude" xmlns="http://www.wmo.ch/web/www/metadata" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.2">
	<xs:annotation>
		<xs:documentation>
This is a draft schema for the Met Office JEDDS demonstrator Project.
written by G.H.Ross first draft March 04.
</xs:documentation>
	</xs:annotation>
	<!-- Include MD_Metadata Class  -->
	<xs:include schemaLocation="../WMO19115_metadata_v0_2.xsd"/>
	<!-- Import XInclude schema-->
	<xs:import namespace="http://www.w3.org/2003/XInclude" schemaLocation="../XInclude.xsd"/>
	<!--  root element *************************************************************************************************** -->
	<xs:element name="WMOBulletinSet">
		<xs:annotation>
			<xs:documentation>The root document is a set of WMO Bulletins, each of which has a cut-down metadata tag with only the variable metadata in WMO Core Profile of the ISO19115 standard. In fact the core standard has been extended, anticipating the 4th ET-IDM meeting to include Content information comprising either coverage or feature catalogue information. In fact the full WMO Core Profile schema is not referenced directly because of validation problems.
The data tag has really only raw data in this schema, since parsed raw data requires a schema of its own comprising element sets of the named groups.  
	</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="WMOBulletin" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<!-- complex types -->
	<xs:complexType name="WMOBulletinType">
		<xs:sequence>
			<xs:element ref="metadata"/>
			<xs:element ref="data"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="WMOBulletinMetadataType">
		<xs:annotation>
			<xs:documentation>
This should properly reference the WMO Core Profile of ISO 19115.
However validation problems meant that the formal reference has been remooved
</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element ref="metadataFileIdentifier">
				<xs:annotation>
					<xs:documentation>
The base reference is xs:string. Here we suggest that it should be transformed to xs:anyURI
The URI is a unique identifier referring to the bulletin.
A suggested form is:
/EGRR/SYNOP/03772/2003-11-26T11:00:00
as a SYNOP bulletin disseminated by EGRR for Heathrow 03772 at the date and time.
The base for the full URI should be defined in the root document (although not done here).
From this path there should be available sufficient information that the static data in the WMO Core Profile 
can be added to the template of a full document by a dedicated XSLT script. 
	 		</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element ref="resourceIdentifier">
				<xs:annotation>
					<xs:documentation>
Here the Bulletin Collection is identified as the resource from which the bulletin was extracted. This is the only plce where the AHL Abbreviated Header List is referenced.
This too is more complicated than the allowed string, and should be an XML fragment itself.
			</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element ref="descriptiveKeywords"/>
			<xs:element ref="date"/>
			<xs:choice>
				<xs:element ref="point"/>
				<xs:element ref="boundingBox"/>
			</xs:choice>
			<xs:element ref="geographicIdentifier" minOccurs="0">
				<xs:annotation>
					<xs:documentation>
For the DDS the geographic identifier included more complex information. It was compressed into a string to avoid for the present, the complication of including WMO or ICAO set specific encoding.
			</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:choice minOccurs="0">
				<xs:element ref="featureCatalogue"/>
				<xs:element ref="coverage"/>
			</xs:choice>
			<xs:element ref="temporalElement"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="WMOBulletinDataType">
		<xs:annotation>
			<xs:documentation>
Here the data is appended as raw data or parsed grouped data or fully parsed data
</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element ref="rawData"/>
			<xs:element ref="parsedGroupedData" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="featureCatalogueType">
		<xs:annotation>
			<xs:documentation>
This is where the feature catalogue conforming tor ISO19110 is referenced. The catalogue Name should be the name of the future WMO feature catalogue repository, and the featureName is the name of the particular feature collection or feature type defind within, e.g. SYNOP. 
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element ref="featureCatalogueCitation" minOccurs="0"/>
			<xs:element ref="featureTypes" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="coverageType">
		<xs:annotation>
			<xs:documentation>
This coverage feature list is set up for WMO GRIB coverage elements.
element variableField is the parameter which varies at each point of the grid
element fixedField is the level or layer parameter foxed at every point.
For example: Temperature varying at every grid point defined at a height level of 3000m
or conversely, the lowest height variable at each grid point at which the 0C temperature is crossed, if indeed it is crossed.
group coverageGeometry is a coding of the GRIB latitude-longitude grid definition translated to ISO terms
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="variableField" type="xs:string"/>
			<xs:element name="fixedField" type="xs:string" maxOccurs="2"/>
			<xs:group ref="coverageGeometry" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:group name="coverageGeometry">
		<xs:annotation>
			<xs:documentation>
This group is a coding of the GRIB latitude-longitude grid definition translated to ISO terms
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="corner1Lat" type="xs:decimal"/>
			<xs:element name="corner1Lon" type="xs:decimal"/>
			<xs:element name="corner2Lat" type="xs:decimal"/>
			<xs:element name="corner2Lon" type="xs:decimal"/>
			<xs:element name="deltaLat" type="xs:decimal"/>
			<xs:element name="deltaLon" type="xs:decimal"/>
			<xs:element name="numberLatPoints" type="xs:decimal"/>
			<xs:element name="numberLonPoints" type="xs:decimal"/>
			<xs:element name="scanning" type="xs:string"/>
		</xs:sequence>
	</xs:group>
	<!-- ********************************************************************************************************************* -->
	<!-- reference elements ______________________________________________________________ -->
	<!-- ********************************************************************************************************************* -->
	<xs:element name="WMOBulletin" type="WMOBulletinType"/>
	<xs:element name="metadata" type="WMOBulletinMetadataType"/>
	<xs:element name="data" type="WMOBulletinDataType"/>
	<xs:element name="featureCatalogue" type="featureCatalogueType"/>
	<xs:element name="coverage" type="coverageType"/>
	<xs:element name="rawData" type="xs:string"/>
	<xs:element name="parsedGroupedData">
		<xs:complexType>
			<xs:sequence>
				<xs:any namespace="##other" processContents="lax"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

