<?xml version="1.0" encoding="UTF-8"?>
<!--
Version : 1.0.4
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Solution">
    <xs:complexType>
      <xs:sequence> 
        <xs:element name="ProblemFile" type="xs:string"         minOccurs="0"/> <!-- Can be relative to the solution or an absolute file path  -->
        <xs:element name="Penalty"     type="nonNegativeDouble" minOccurs="0"/>
        <xs:element name="TimeStamp"   type="xs:dateTime"       minOccurs="0"/>
        <xs:element name="Author"      type="xs:string"         minOccurs="0"/>
        <xs:element name="Reference"   type="xs:string"         minOccurs="0"/>
        <xs:element name="Machine"     type="xs:string"         minOccurs="0"/>
        <xs:element name="SolveTime"   type="TimeSpan"          minOccurs="0"/>
        <xs:element name="Employee" minOccurs="0" maxOccurs="unbounded" type="Employee"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>    
    
  <xs:complexType name="Employee">
    <xs:sequence>
      <xs:element name="Shift" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Day"   minOccurs="1" maxOccurs="1" type="xs:nonNegativeInteger"/>
            <xs:element name="Start" minOccurs="1" maxOccurs="1" type="xs:time"/>
            <xs:element name="Task"  minOccurs="1" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="ID"     minOccurs="1" maxOccurs="1" type="xs:string"/>
                  <xs:element name="Length" minOccurs="1" maxOccurs="1" type="xs:nonNegativeInteger"/>
                </xs:sequence>
                <xs:attribute name="WorkLength"              type="nonNegativeDouble" use="required"/>
                <xs:attribute name="preDependentTaskID"      type="xs:string"         use="optional"/>
                <xs:attribute name="preDependentTaskLength"  type="nonNegativeDouble" use="optional"/>
                <xs:attribute name="postDependentTaskID"     type="xs:string"         use="optional"/>
                <xs:attribute name="postDependentTaskLength" type="nonNegativeDouble" use="optional"/>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="ExternalID" type="xs:string" use="optional"/>
          <xs:attribute name="BreakDefID" type="xs:string" use="optional"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="ID" type="xs:string" use="required"/>
  </xs:complexType>
        
  <xs:simpleType name="nonNegativeDouble">
    <xs:restriction base="xs:double">
      <xs:minInclusive value="0"/>
    </xs:restriction>
  </xs:simpleType>
  
  <xs:simpleType name="TimeSpan"> <!-- e.g. 1.00:00, 19:30:00, 09:15,  -->
    <xs:restriction base="xs:string">
      <xs:pattern value="([0-9]{1,7}|([0-9]{1,7}\.)?(([01]?[0-9])|(2[0-3])):[0-5]?[0-9](:[0-5]?[0-9])?)"/>
    </xs:restriction>
  </xs:simpleType>
   
</xs:schema>