<?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_Cert7Summ">
	<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, Cert7Summ, NIAB</xs:appinfo>
	</xs:annotation>
	<xs:include schemaLocation="SC_Common.xsd" />
	<xs:element name="Cert7Summ" type="SeedCerts:Cert7SummType">
		<xs:annotation>
			<xs:documentation>Root element for SeedCerts Cert7Summ</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:complexType name="Cert7SummType">
		<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="Cert7SummDetails" type="SeedCerts:Cert7SummStructure" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Structure containing details for Cert7Summ 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 Cert7SummStructure type definition -->
	<xs:complexType name="Cert7SummStructure">
		<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="Cert7SummLine" type="SeedCerts:Cert7SummLineStructure" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Structure containing seed lot details</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- End of Cert7SummStructure type definition -->
	<!-- ==================== -->
	<!-- Common Complex Types -->
	<!-- ==================== -->
	<xs:complexType name="Cert7SummLineStructure">
		<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="ApplicationLineID" 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="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>New seed lot reference number</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="NetWeight" type="SeedCerts:WeightType">
				<xs:annotation>
					<xs:documentation>Net weight for seed lot</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="CategoryLevel" type="SeedCerts:CategoryType">
				<xs:annotation>
					<xs:documentation>Category for seed lot</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="Upgrade" type="SeedCerts:YesNoType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Upgrade request for re-entries</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="ReClean" type="SeedCerts:YesNoType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Denotes reclean for seed lot</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="LineParent">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="ApplicationLineID" 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="Retest" type="SeedCerts:YesNoType">
							<xs:annotation>
								<xs:documentation>Denotes retest for seed lot</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:choice>
							<xs:element name="CropIdentityNo" type="SeedCerts:CropIdentityNoType" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Original crop identity number</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="OriginalSLRN" type="SeedCerts:SLRNFreeFormatType" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Original 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:choice>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="VarietyDetails" type="SeedCerts:VarietyStructure">
				<xs:annotation>
					<xs:documentation>Structure containing variety 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 Cert7SummLineStructure -->
</xs:schema>
