<?xml version="1.0"?>
<!-- $Header: https://oberon.oapd.inaf.it/shins/branches/gigan-virgin_system/templates/schema/ObservationBlock.xsd 2095 2019-08-23 09:03:52Z depa $ -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Schema definition for SHARK-NIR Observation Blocks    -->
<!-- You can check an OB using (e.g.):                     -->
<!-- $ xmllint \-\-schema ObservationBlock.xsd testOB1.xml -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
        version="0.1"
        elementFormDefault="unqualified">

  <xs:include schemaLocation="tiptiltCtrlSetup.xsd"/>

  <xs:include schemaLocation="detectorSetup.xsd"/>

  <xs:include schemaLocation="instrumentSetup.xsd"/>

  <xs:include schemaLocation="telescopeSetup.xsd"/>

  <xs:include schemaLocation="infoSetup.xsd"/>

  <!-- <!-\- ~~~~~~~~~~~~~~~~~~~~~~ -\-> -->
  <!-- <!-\- OBID                -\-> -->
  <!-- <!-\- ~~~~~~~~~~~~~~~~~~~~~~ -\-> -->
  <!-- <xs:simpleType name="OBID"> -->
  <!--   <xs:restriction base="xs:string"> -->
  <!--   </xs:restriction> -->
  <!-- </xs:simpleType> -->

  <!-- <!-\- ~~~~~~~~~~~~~~~~~~~~~~ -\-> -->
  <!-- <!-\- PIName                -\-> -->
  <!-- <!-\- ~~~~~~~~~~~~~~~~~~~~~~ -\-> -->
  <!-- <xs:simpleType name="PIName"> -->
  <!--   <xs:restriction base="xs:string"> -->
 
  <!--   </xs:restriction> -->
  <!-- </xs:simpleType> -->

  <!-- <!-\- ~~~~~~~~~~~~~~~~~~~~~~ -\-> -->
  <!-- <!-\- ProgramID                -\-> -->
  <!-- <!-\- ~~~~~~~~~~~~~~~~~~~~~~ -\-> -->
  <!-- <xs:simpleType name="ProgramID"> -->
  <!--   <xs:restriction base="xs:string"> -->
 
  <!--   </xs:restriction> -->
  <!-- </xs:simpleType> -->

  <!-- <!-\- ~~~~~~~~~~~~~~~~~~~~~~ -\-> -->
  <!-- <!-\- PIID                -\-> -->
  <!-- <!-\- ~~~~~~~~~~~~~~~~~~~~~~ -\-> -->
  <!-- <xs:simpleType name="PIID"> -->
  <!--   <xs:restriction base="xs:string"> -->
 
  <!--   </xs:restriction> -->
  <!-- </xs:simpleType> -->


  
  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Observation Block Type -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:complexType name="ObservationBlock_Type" mixed="false">
    <xs:sequence>
      <xs:element ref="Template" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="OBID" type="xs:string"/>
    <xs:attribute name="ProgramID" type="xs:string"/>
    <xs:attribute name="PIName" type="xs:string"/>
    <xs:attribute name="PIID" type="xs:string"/>
  </xs:complexType>


  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Script                 -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="Script_Type">
    <xs:restriction base="xs:string" />
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- TPLID                  -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="TPLID_Type">
    <xs:restriction base="xs:string">
      <xs:maxLength value="64" />
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- TPLName                -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="TPLName_Type">
    <xs:restriction base="xs:string">
      <xs:maxLength value="64" />
    </xs:restriction>
  </xs:simpleType>




  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Reference Setup        -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:complexType name="ReferenceSetup_Type" mixed="false">
    <xs:all>
      <xs:element name="Script"           type="Script_Type"           minOccurs="0" maxOccurs="1"/>
      <xs:element name="TelescopeSetup"   type="TelescopeSetup_Type"   minOccurs="0" maxOccurs="1"/>
      <xs:element name="DetectorSetup"    type="DetectorSetup_Type"    minOccurs="0" maxOccurs="1"/>
      <xs:element name="InstrumentSetup"  type="InstrumentSetup_Type"  minOccurs="0" maxOccurs="1"/>
      <xs:element name="TipTiltCtrlSetup" type="TipTiltCtrlSetup_Type" minOccurs="0" maxOccurs="1"/>
    </xs:all>
  </xs:complexType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Template               -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:complexType name="Template_Type" mixed="false">
    <xs:all>
      <xs:element name="TPLID"            type="TPLID_Type"            minOccurs="1" maxOccurs="1"/>
      <xs:element name="TPLName"          type="TPLName_Type"          minOccurs="1" maxOccurs="1"/>
      <xs:element name="InfoSetup"        type="InfoSetup_Type"        minOccurs="0" maxOccurs="1"/>
      <xs:element name="DetectorSetup"    type="DetectorSetup_Type"    minOccurs="0" maxOccurs="1"/>
      <xs:element name="InstrumentSetup"  type="InstrumentSetup_Type"  minOccurs="0" maxOccurs="1"/>
      <xs:element name="TelescopeSetup"   type="TelescopeSetup_Type"   minOccurs="0" maxOccurs="1"/>
      <xs:element name="TipTiltCtrlSetup" type="TipTiltCtrlSetup_Type" minOccurs="0" maxOccurs="1"/>
    </xs:all>
  </xs:complexType>
  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Actual XML elements    -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:element name="ObservationBlock" type="ObservationBlock_Type"/>
  <xs:element name="Template" type="Template_Type"/>
  <xs:element name="ReferenceSetup" type="ReferenceSetup_Type"/>
</xs:schema>
