<!--SIF Implementation Specification UK 1.1-4 (September 18, 2009)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.sifinfo.org/uk/infrastructure/2.x" xmlns:sif="http://www.sifinfo.org/uk/infrastructure/2.x" elementFormDefault="qualified">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="imports/xml/xml.xsd" />
  <xs:complexType name="LearnerAttendanceSummaryType">
    <xs:annotation>
      <xs:documentation>This object provides a summary of a learner's daily attendance and membership information for a given school during the time period between the StartDate and EndDate, inclusive. As such, there may be multiple instances of this object for a learner in a school over the course of an academic school year.  Note that sessions are defined by each school and in most cases is two but can be any number in the range 1-10.  Compare with US/Canada object: </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element ref="sif:SchoolYear" minOccurs="0" />
      <xs:element name="StartDate" minOccurs="0" type="xs:date">
        <xs:annotation>
          <xs:documentation>Starting date of this attendance reporting period.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="EndDate" minOccurs="0" type="xs:date">
        <xs:annotation>
          <xs:documentation>Ending date of this attendance reporting period.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ReasonsList" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Reason" minOccurs="0" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="Code" minOccurs="0" type="sif:UKAttendanceCodeType">
                    <xs:annotation>
                      <xs:documentation>The attendance code.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="Type" minOccurs="0">
                    <xs:annotation>
                      <xs:documentation>The attendance code type.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:token">
                        <xs:enumeration value="Absent" />
                        <xs:enumeration value="EarlyDeparture" />
                        <xs:enumeration value="Late" />
                        <xs:enumeration value="Partial" />
                        <xs:enumeration value="Present" />
                        <xs:enumeration value="Other" />
                        <xs:enumeration value="NA" />
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                  <xs:element name="Status" minOccurs="0">
                    <xs:annotation>
                      <xs:documentation>The authorised status of the attendance code.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:token">
                        <xs:enumeration value="Authorised" />
                        <xs:enumeration value="Unauthorised" />
                        <xs:enumeration value="Unknown" />
                        <xs:enumeration value="NA" />
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                  <xs:element name="Total" minOccurs="0" type="xs:unsignedInt">
                    <xs:annotation>
                      <xs:documentation>The total number of sessions attributed to this reason between StartDate and EndDate for the specified reason.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="SessionsAttendedTotal" minOccurs="0" type="xs:unsignedInt">
        <xs:annotation>
          <xs:documentation>The number of sessions the learner attended school when school was in session between the StartDate and EndDate, inclusive.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SessionsPossible" minOccurs="0" type="xs:unsignedInt">
        <xs:annotation>
          <xs:documentation>The number of sessions the learner was present plus the number of sessions the learner was absent (authorised and unauthorised) when school was in session during the period between the StartDate and EndDate, inclusive.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AuthorisedAbsences" minOccurs="0" nillable="true" type="xs:unsignedInt">
        <xs:annotation>
          <xs:documentation>The number of sessions the learner was absent from school with a valid excuse when school was in session between the StartDate and EndDate, inclusive. Note that ts column can be derived from Reason Status.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="UnauthorisedAbsences" minOccurs="0" nillable="true" type="xs:unsignedInt">
        <xs:annotation>
          <xs:documentation>The number of sessions the learner was absent from school without a valid excuse when school was in session between the StartDate and EndDate, inclusive.  Note that this column can be derived from Reason Status.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AlternativeTuitionHours" minOccurs="0" nillable="true" type="sif:UKTuitionHoursType">
        <xs:annotation>
          <xs:documentation>Number of Alternative Tuition (whole) hours attended between the StartDate and EndDate, inclusive.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SIF_Metadata" minOccurs="0" nillable="true" type="sif:SIF_MetadataType" />
      <xs:element name="SIF_ExtendedElements" minOccurs="0" nillable="true" type="sif:SIF_ExtendedElementsType">
        <xs:unique name="SIF_ExtendedElementsKey15">
          <xs:selector xpath="./sif:SIF_ExtendedElement" />
          <xs:field xpath="@Name" />
        </xs:unique>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="LearnerPersonalRefId" use="required" type="sif:IdRefType">
      <xs:annotation>
        <xs:documentation>The ID (GUID) of the learner for whom this attendance information is being reported.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="SchoolInfoRefId" use="required" type="sif:IdRefType">
      <xs:annotation>
        <xs:documentation>The ID (GUID) of the school for which this attendance information is being reported.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="LearnerAttendanceSummary" type="sif:LearnerAttendanceSummaryType">
    <xs:key name="LearnerAttendanceSummaryKey1">
      <xs:selector xpath="." />
      <xs:field xpath="@LearnerPersonalRefId" />
      <xs:field xpath="@SchoolInfoRefId" />
      <xs:field xpath="./sif:SchoolYear" />
      <xs:field xpath="./sif:StartDate" />
      <xs:field xpath="./sif:EndDate" />
    </xs:key>
  </xs:element>

</xs:schema>