<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Defra (DEFRA) -->
<xs:schema targetNamespace="urn:defra.gov.uk:ESP:SeedCerts" xmlns:gt="http://www.govtalk.gov.uk/Schemas/govtalk/core" xmlns:SeedCerts="urn:defra.gov.uk:ESP:SeedCerts" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="5.1" id="DEFRA_SeedCert_Cert4">
	<xs:annotation>
		<xs:documentation>This schema is used for submitting Seed Cert forms through the Gateway to Defra and NIAB</xs:documentation>
		<xs:appinfo>Defra, Seed Certification, Cert4, NIAB</xs:appinfo>
	</xs:annotation>
	<xs:include schemaLocation="SC_Common.xsd"/>
	<xs:element name="Cert4" type="SeedCerts:Cert4Type">
		<xs:annotation>
			<xs:documentation>Root element for SeedCerts Cert4</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:complexType name="Cert4Type">
		<xs:sequence>
			<xs:element name="MessageCreationTimestamp" type="xs:dateTime" minOccurs="0">
				<xs:annotation>
					<xs:documentation>For internal use only - should not be populated by external applications</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="Cert4Details" type="SeedCerts:Cert4Structure" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Structure containing details for Cert4 applications</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- Start of Cert4Structure type definition -->
	<xs:complexType name="Cert4Structure">
		<xs:sequence>
			<!-- Action element is for internal use, do not populate for uploaded applications -->
			<xs:element name="Action" type="SeedCerts:ActionType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>For internal use only - should not be populated by external applications</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="ApplicationID" type="SeedCerts:ProgramIDType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>For internal use only - should not be populated by external applications</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="ApplicantOfficialNumber" type="SeedCerts:OfficialNumberType">
				<xs:annotation>
					<xs:documentation>Unique number assigned to applicant by Defra</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="Cert4Line" type="SeedCerts:Cert4BulkStructure" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Structure containing bulk details</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- End of Cert4Structure type definition -->
	<!-- ==================== -->
	<!-- Common Complex Types -->
	<!-- ==================== -->
	<xs:complexType name="Cert4BulkStructure">
		<xs:annotation>
			<xs:documentation>Contains details of the bulks being submitted for the application</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="ApplicationID" type="SeedCerts:ProgramIDType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>For internal use only - should not be populated by external applications</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="BulkID" type="SeedCerts:ProgramIDType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>For internal use only - should not be populated by external applications</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="BulkEntryNo" type="SeedCerts:CropIdentityNoType">
				<xs:annotation>
					<xs:documentation>Crop identity number</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="CategoryLevel" type="SeedCerts:CategoryType">
				<xs:annotation>
					<xs:documentation>Category for species and variety combination</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="VarietyDetails" type="SeedCerts:VarietyStructure">
				<xs:annotation>
					<xs:documentation>Structure containing variety details</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="CropDetails" type="SeedCerts:Cert4LineStructure" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Structure containing crop line details</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="RowNo" type="xs:positiveInteger" use="optional">
			<xs:annotation>
				<xs:documentation>For internal use only - should not be populated by external applications</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<!-- End of Cert4BulkStructure -->
	<xs:complexType name="Cert4LineStructure">
		<xs:annotation>
			<xs:documentation>Contains details of the crops being submitted within each bulk and links to details on the prior Cert2</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="ApplicationID" type="SeedCerts:ProgramIDType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>For internal use only - should not be populated by external applications</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="BulkID" type="SeedCerts:ProgramIDType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>For internal use only - should not be populated by external applications</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="KeyCrop" type="SeedCerts:YesNoType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>For internal use only - should not be populated by external applications</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="CropIdentityNo" type="SeedCerts:CropIdentityNoType">
				<xs:annotation>
					<xs:documentation>Crop identity number</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
</xs:schema>
