<?xml version="1.0" encoding="UTF-8"?>
<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="4.2" id="DEFRA_SeedCert_Cert7">
	<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, Cert7, NIAB</xs:appinfo>
	</xs:annotation>
	<xs:include schemaLocation="SC_Common.xsd"/>
	<xs:element name="Cert7" type="SeedCerts:Cert7Type">
		<xs:annotation>
			<xs:documentation>Root element for SeedCerts Cert7</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:complexType name="Cert7Type">
		<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="Cert7Details" type="SeedCerts:Cert7Structure" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Structure containing details for Cert7 applications</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="PaymentDetails" type="SeedCerts:PaymentDetailsStructure" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Structure containing details of payments made for forms submissions, includes Defra and Gateway generated IDs, but no credit card details</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- Start of Cert7Structure type definition -->
	<xs:complexType name="Cert7Structure">
		<xs:sequence>
			<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="AFPNumber" type="SeedCerts:AFPNumberType" 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="PrimarySLRN" type="SeedCerts:SLRNType">
				<xs:annotation>
					<xs:documentation>Primary seed lot reference number</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="TotalNetWeight" type="SeedCerts:WeightType">
				<xs:annotation>
					<xs:documentation>Total net weight for application</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="Cert7Line" type="SeedCerts:Cert7LineStructure" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Structure containing seed lot constituent details</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- End of Cert7Structure type definition -->
	<!-- ==================== -->
	<!-- Common Complex Types -->
	<!-- ==================== -->
	<xs:complexType name="Cert7LineStructure">
		<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:choice>
				<xs:element name="OriginalSLRN" type="SeedCerts:SLRNFreeFormatType">
					<xs:annotation>
						<xs:documentation>Constituent seed lot reference number</xs:documentation>
						<xs:documentation>For England &amp; Wales format - seed lot year (4 digits must be entered)/category (2 characters)/applicant number (up to 5 digits)/seed lot number (up to 4 digits)</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="CropIdentityNo" type="SeedCerts:CropIdentityNoType">
					<xs:annotation>
						<xs:documentation>Constituent crop identity number</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:choice>
			<xs:element name="NetWeight" type="SeedCerts:WeightType">
				<xs:annotation>
					<xs:documentation>Net weight for constituent</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 Cert7LineStructure -->
</xs:schema>
