<!--
		SIF Implementation Specification (New Zealand) 3.1
		(8 December, 2020
)
		
		Infrastructure Version: v3.1
	-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sifassociation.org/datamodel/nz/3.1" targetNamespace="http://www.sifassociation.org/datamodel/nz/3.1" elementFormDefault="qualified" version="3.1 (rc 5)">
  <xs:complexType name="TeachingGroupType">
    <xs:sequence>
      <xs:element name="TeachingGroupRefId" minOccurs="0" nillable="true" type="RefIdType" />
      <xs:element name="TeachingGroupLocalId" minOccurs="0" nillable="true" type="LocalIdType" />
      <xs:element name="ShortName" minOccurs="0" type="xs:normalizedString" />
      <xs:element name="LongName" minOccurs="0" nillable="true" type="xs:normalizedString" />
      <xs:element name="GroupType" minOccurs="0" nillable="true" type="NZCodeSetsTeachingGroupTypeType" />
      <xs:element name="Provider" minOccurs="0" type="ProviderObjectReferenceType" />
      <xs:element name="TeachingProvider" minOccurs="0" nillable="true" type="ObjectReferenceType" />
      <xs:element name="ScheduleTerm" minOccurs="0" nillable="true" type="ObjectReferenceType" />
      <xs:element name="StudentList" minOccurs="0" nillable="true" type="StudentListType" />
      <xs:element name="TeacherList" minOccurs="0" nillable="true" type="StaffListType" />
      <xs:element name="CourseList" minOccurs="0" nillable="true" type="CourseListType" />
      <xs:element name="SubjectAreaList" minOccurs="0" nillable="true" type="SubjectAreaListType" />
      <xs:element name="YearLevelList" minOccurs="0" nillable="true" type="YearLevelListType" />
      <xs:element name="RecordAudit" minOccurs="0" nillable="true" type="RecordAuditType" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="TeachingGroup" type="TeachingGroupType">
    <xs:unique name="TeachingGroupKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./TeachingGroupRefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="TeachingGroupCollectionType">
    <xs:sequence>
      <xs:element name="TeachingGroup" type="TeachingGroupType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="TeachingGroups" type="TeachingGroupCollectionType" />

</xs:schema>