<!--
		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="DocumentType">
    <xs:sequence>
      <xs:element name="DocumentRefId" minOccurs="0" nillable="true" type="RefIdType" />
      <xs:element name="DocumentLocalId" minOccurs="0" nillable="true" type="LocalIdType" />
      <xs:element name="Provider" type="ProviderObjectReferenceType" />
      <xs:element name="Location" minOccurs="0" nillable="true" type="xs:normalizedString" />
      <xs:element name="DocumentTitle" type="xs:normalizedString" />
      <xs:element name="DocumentDescription" minOccurs="0" nillable="true" type="xs:normalizedString" />
      <xs:element name="AddedDateTime" minOccurs="0" nillable="true" type="xs:dateTime" />
      <xs:element name="ReviewDate" minOccurs="0" nillable="true" type="xs:date" />
      <xs:element name="URL" minOccurs="0" nillable="true" type="xs:anyURI" />
      <xs:element name="NoteText" minOccurs="0" nillable="true" type="xs:normalizedString" />
      <xs:element name="RelatedToList" minOccurs="0" nillable="true" type="RelatedToListType" />
      <xs:element name="DocumentClassification" minOccurs="0" nillable="true" type="NZCodeSetsDocumentClassificationType" />
      <xs:element name="DocumentType" type="NZCodeSetsDocumentTypeType" />
      <xs:element name="PersonDocumentRoleList" minOccurs="0" nillable="true" type="PersonDocumentRoleListType" />
      <xs:element name="DocumentDate" minOccurs="0" nillable="true" type="xs:date" />
      <xs:element name="RecordAudit" minOccurs="0" nillable="true" type="RecordAuditType" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="Document" type="DocumentType">
    <xs:key name="DocumentKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./DocumentRefId" />
    </xs:key>
  </xs:element>

  <xs:complexType name="DocumentCollectionType">
    <xs:sequence>
      <xs:element name="Document" type="DocumentType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Documents" type="DocumentCollectionType" />

</xs:schema>