<!--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="SchoolGroupType">
    <xs:annotation>
      <xs:documentation>This object describes a specific group and includes resource and time tabling information.  All groups are based upon a SchoolGroupType record. However, there are courses which are not based upon any subject area and likewise may not have any teachers or other staff assigned.  Compare with US/Canada object:  </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element ref="sif:LocalId" />
      <xs:element name="GroupName" type="xs:normalizedString">
        <xs:annotation>
          <xs:documentation>The name associated with this group for display purposes.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Description" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:documentation>A textual description.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ParentSchoolGroupRefId" minOccurs="0" nillable="true" type="sif:IdRefType">
        <xs:annotation>
          <xs:documentation>The parent group associated with this group, if any.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ScheduleInfoList" minOccurs="0" nillable="true">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="ScheduleInfo" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="TeacherList" minOccurs="0" nillable="true">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="Teacher" maxOccurs="unbounded">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element name="Role" minOccurs="0" nillable="true" type="sif:UKGroupRoleType">
                                <xs:annotation>
                                  <xs:documentation>The role associated with this person in the context of this group.</xs:documentation>
                                </xs:annotation>
                              </xs:element>
                            </xs:sequence>
                            <xs:attribute name="WorkforcePersonalRefId" use="required" type="sif:IdRefType">
                              <xs:annotation>
                                <xs:documentation>The ID (GUID) of a teacher, staff member, or other employee participating in a non-learner capacity within this group.</xs:documentation>
                              </xs:annotation>
                            </xs:attribute>
                          </xs:complexType>
                        </xs:element>
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </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:key name="SIF_ExtendedElementsKey24">
          <xs:selector xpath="./sif:SIF_ExtendedElement" />
          <xs:field xpath="@Name" />
        </xs:key>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="RefId" use="required" type="sif:RefIdType">
      <xs:annotation>
        <xs:documentation>The ID (GUID) that uniquely identifies this group entity.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="SchoolGroupTypeRefId" use="required" type="sif:IdRefType">
      <xs:annotation>
        <xs:documentation>The ID (GUID) that identifies a course upon which this group is centered. Note that this element is mandatory when GroupType is associated with a course (teaching group).</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="SchoolYear" use="required" type="sif:SchoolYearType">
      <xs:annotation>
        <xs:documentation>School year for which the group is applicable, expressed as the four-digit year in which the school year ends (e.g. 2007 for the 2006/07 school year). Where a group membership is valid across multiple years, the current year at the time of publication will be used.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="SchoolGroup" type="sif:SchoolGroupType">
    <xs:key name="SchoolGroupKey1">
      <xs:selector xpath="." />
      <xs:field xpath="@RefId" />
    </xs:key>
  </xs:element>

</xs:schema>