<!--
		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="CredentialType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>Low</privacyRating>
      </xs:appinfo>
      <xs:documentation>A qualification or other award published by a national body, professional association or 
      other interested party. The Credential recognises a set of learning that students have undertaken
      and successfully completed.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="CredentialRefId" minOccurs="0" nillable="true" type="RefIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The universally unique identifier for the data object record that is used across systems.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="CredentialLocalId" minOccurs="0" nillable="true" type="LocalIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Code assigned by the Credential administrator to identify the CreLocalIddential.  This may not uniquely identify the Credential, where there may be multiple editions or versions of a particular Credential. The Id of the data object record that was provided by the system that the information was originally sourced from.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Title" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The name of the Credential. eg: "NCEA Level 1"</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="VersionNo" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The version number of the Credential.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Administrator" minOccurs="0" nillable="true" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Generic object reference to the Provider or Organisation that administers the Credential</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Description" minOccurs="0" nillable="true" type="xs:string">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Description of the credential</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SubjectAreaList" minOccurs="0" nillable="true" type="SubjectAreaListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Which standard MoE Learning / Subject Areas is this Credential part of?</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Status" minOccurs="0" nillable="true" type="NZCodeSetsCredentialStatusType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A code denoting the current status of the Credential, as set by the Administrator.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PublicationDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>This is the date that the administering organization published the Credential.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SupercededDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The date the administering organization superceded (or will supercede) 
      the Credential. May be future dated.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="DiscontinuedDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The date the administering organization discontinued (or will discontinue) 
        the Credential.  May be future dated.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Credits" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The number of course (or other qualification) credits that will be 
        achieved by attaining this Credential.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Level" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The level of the credential if applicable, eg. 1,2 or 3 for NCEA levels</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RelatedLearningStandardList" minOccurs="0" nillable="true" type="RelatedLearningStandardsListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of related LearningStandard references</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RecordAudit" minOccurs="0" nillable="true" type="RecordAuditType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The audit details for a record, e.g. Created/Last Updated DateTime and Created/Last Updated By.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:element name="Credential" type="CredentialType">
    <xs:key name="CredentialKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./CredentialRefId" />
    </xs:key>
  </xs:element>

  <xs:complexType name="CredentialCollectionType">
    <xs:sequence>
      <xs:element name="Credential" type="CredentialType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Credentials" type="CredentialCollectionType" />

</xs:schema>