<?xml version = "1.0" ?>
 
<xsd:schema  
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

            <!-- documentation of schema file --> 
  <xsd:annotation> 
    <xsd:documentation xml:lang="en"> 
      This is an SNARK05 recfil schema file.
      See RECFIL.xml for an instance file of this type,
      it will clear up how such a file should look.
      Version:  $Revision: 1.5 $ 
      Last Updated:  $Date: 2006/03/22 14:14:14 $ 
    </xsd:documentation> 
  </xsd:annotation> 
 
  <xsd:element name="DIG_DATA">
    <xsd:complexType> 
      <xsd:sequence> 
        <xsd:element name="main_header"> 
          <xsd:complexType>
            <xsd:sequence> 
              <xsd:element name="comments" type="xsd:string" minOccurs="0"/> 
              <xsd:element name="dimensions">
                <xsd:complexType>  <!-- dimensions is vector (NELEM, NELEM, 1) -->
						<xsd:attribute name="x" type="oddPositiveInteger" use="required"/> 
						<xsd:attribute name="y" type="oddPositiveInteger" use="required"/> 
						<xsd:attribute name="z" type="oddPositiveInteger" fixed="1"/> 
                </xsd:complexType> 
              </xsd:element>  <!-- dimensions -->  
              <xsd:element name="sampling_rate_x">
                <xsd:complexType>  <!-- sampling_rate_x is vector (PIXSIZ, 0, 0) -->
                  <xsd:attribute name="x" type="positiveReal" use="required"/> 
                  <xsd:attribute name="y" type="nonNegativeReal" fixed="0"/> 
                  <xsd:attribute name="z" type="nonNegativeReal" fixed="0"/> 
                </xsd:complexType> 
              </xsd:element>  <!-- sampling_rate_x -->
              <xsd:element name="sampling_rate_y">
                <xsd:complexType>  <!-- sampling_rate_y is vector (0, PIXSIZ, 0) -->
                  <xsd:attribute name="x" type="nonNegativeReal" fixed="0"/> 
                  <xsd:attribute name="y" type="positiveReal" use="required"/> 
                  <xsd:attribute name="z" type="nonNegativeReal" fixed="0"/> 
                </xsd:complexType> 
              </xsd:element>  <!-- sampling_rate_y -->
              <xsd:element name="sampling_rate_z">
                <xsd:complexType>  <!-- sampling_rate_z is vector (0, 0, 0) -->
                  <xsd:attribute name="x" type="nonNegativeReal" fixed="0"/> 
                  <xsd:attribute name="y" type="nonNegativeReal" fixed="0"/> 
                  <xsd:attribute name="z" type="nonNegativeReal" fixed="0"/> 
              </xsd:complexType>
            </xsd:element>  <!-- sampling_rate_z --> 
            </xsd:sequence> 
            <xsd:attribute name="type" use="required"> 
              <xsd:simpleType>
                <xsd:restriction base="xsd:string">
                  <xsd:pattern value="SNARK05 recfil"/>
                </xsd:restriction>
              </xsd:simpleType>
            </xsd:attribute>  <!-- type -->
            <xsd:attribute name="title" type="xsd:string" use="required"/> 
            <xsd:attribute name="channels" use="required"> 
              <xsd:simpleType>
                <xsd:restriction base="xsd:positiveInteger">
                  <xsd:pattern value="1"/>
                </xsd:restriction>
              </xsd:simpleType>
            </xsd:attribute>  <!-- channels -->
            <xsd:attribute name="number_of_arrays" type="xsd:positiveInteger" 
                use="required"/> 
            <xsd:attribute name="number_of_array_sets" type="xsd:positiveInteger" 
                use="required"/> 
            <xsd:attribute name="endian" use="required">
              <xsd:simpleType>
                <xsd:restriction base="xsd:string"> 
                  <xsd:pattern value="little|big"/> 
                </xsd:restriction> 
              </xsd:simpleType> 
            </xsd:attribute>  <!-- endian -->
            <xsd:attribute name="value_type" use="required">
              <xsd:simpleType> 
                <xsd:restriction base="xsd:string"> 
                  <xsd:pattern value="real"/> 
                </xsd:restriction> 
              </xsd:simpleType> 
            </xsd:attribute>  <!-- value_type -->
            <xsd:attribute name="data_type" use="required">
              <xsd:simpleType> 
                <xsd:restriction base="xsd:string"> 
                  <xsd:pattern value="double"/> 
                </xsd:restriction> 
              </xsd:simpleType> 
            </xsd:attribute>  <!-- data_type -->
            <xsd:attribute name="data_format" use="required">
              <xsd:simpleType>
                <xsd:restriction base="xsd:string"> 
                  <xsd:pattern value="binary"/> 
                </xsd:restriction> 
              </xsd:simpleType> 
            </xsd:attribute>  <!-- data_format -->
            <xsd:attribute name="grid_type" use="required">
              <xsd:simpleType>
                <xsd:restriction base="xsd:string"> 
                  <xsd:pattern value="SC"/> 
                </xsd:restriction> 
              </xsd:simpleType> 
            </xsd:attribute>  <!-- grid_type -->
            <xsd:attribute name="basis_function" use="required">
              <xsd:simpleType> 
                <xsd:restriction base="xsd:string"> 
                  <xsd:pattern value="voronoi"/> 
                </xsd:restriction> 
              </xsd:simpleType> 
            </xsd:attribute>  <!-- basis_function -->
            <xsd:attribute name="unit" use="required">
              <xsd:simpleType>
                <xsd:restriction base="xsd:string"> 
                  <xsd:pattern value="unspecified"/> 
                </xsd:restriction> 
              </xsd:simpleType> 
            </xsd:attribute>  <!-- unit -->
            <xsd:attribute name="other_unit" use="optional">
              <xsd:simpleType>
                <xsd:restriction base="xsd:string">
                  <xsd:pattern value=""/>
                </xsd:restriction>
              </xsd:simpleType>
            </xsd:attribute>  <!-- other_unit -->
          </xsd:complexType> 
        </xsd:element>  <!-- main_header -->
        <xsd:element name="array_set_header" minOccurs="1" maxOccurs="unbounded"> 
          <xsd:complexType>
            <xsd:sequence> 
              <xsd:element name="comments" type="xsd:string" minOccurs="0"/> 
              <xsd:element name="parameters" type="xsd:string"/>
              <xsd:element name="array_header" minOccurs="1" maxOccurs="unbounded"> 
                <xsd:complexType>
                  <xsd:sequence>
                    <xsd:element name="comments" type="xsd:string" minOccurs="0"/> 
                  </xsd:sequence>
                  <xsd:attribute name="enumeration_number" 
                      type="xsd:nonNegativeInteger" use="required"/> 
                </xsd:complexType>
              </xsd:element>  <!-- array_header -->
            </xsd:sequence> 
            <xsd:attribute name="type" use="required"> 
              <xsd:simpleType>
                <xsd:restriction base="xsd:string">
                  <xsd:pattern value="PHAN|BACK|CONV|RFL|FOUR|DCON|ART|MART|QUAD|SIRT|EMAP|LINO|ALGP|ALGB"/>
                </xsd:restriction>
              </xsd:simpleType>
            </xsd:attribute>  <!-- type -->
            <xsd:attribute name="title" use="required">
              <xsd:simpleType>
                <xsd:restriction base="xsd:string"/>
              </xsd:simpleType>
            </xsd:attribute>  <!-- title -->
          </xsd:complexType> 
        </xsd:element>  <!-- array_set_header -->
      </xsd:sequence> 
    </xsd:complexType>
  </xsd:element>  <!-- DIG_DATA -->

             <!-- type definitions for RECFIL schema -->
  <xsd:simpleType name="nonNegativeReal"> 
    <xsd:restriction base="xsd:decimal"> 
      <xsd:minInclusive value="0"/> 
    </xsd:restriction> 
  </xsd:simpleType>

  <xsd:simpleType name="positiveReal"> 
    <xsd:restriction base="xsd:decimal"> 
      <xsd:minExclusive value="0"/> 
    </xsd:restriction> 
  </xsd:simpleType>

  <xsd:simpleType name="oddPositiveInteger">
    <xsd:restriction base="xsd:integer">   
      <xsd:pattern value="[0-9]*[13579]"/>
    </xsd:restriction>
  </xsd:simpleType>


</xsd:schema>
