<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2006 sp2 U (http://www.altova.com) by Iain King (Dept. for Children, Schools and Families) -->
<!-- Schema for British Standard BS7666 address types -->
<!--
	Changes 1.4 to 1.5
		1.5 v1-2
		For both PAONType and SAONType, the pattern string has been modified from
		<xsd:pattern value="[0-9 ]{4}([A-Z ][0-9 ]{4}[A-Z ][a-zA-Z0-9:;&lt;=&gt;\?@%&amp;'\(\)\*\+,\-\. ]{0,90})?"/> to
		<xsd:pattern value="[0-9 ]{4}([a-zA-Z ][0-9 ]{4}[a-zA-Z ][a-zA-Z0-9:;&lt;=&gt;\?@%&amp;'\(\)\*\+,\-\. ]{0,90})?"/>
		to allow upper or lower case letters in the property number suffix. E.g. "1a" or "1A" are both acceptable.
		
		1.5 v1-1
		Changes made to the SAONtype and PAONtype have been partially reversed
		The original pattern of:    <xsd:pattern value="[0-9 ]{4}[A-Z ]([0-9 ]{4}[A-Z ][a-zA-Z0-9:;&lt;=&gt;\?@%&amp;'\(\)\*\+,\-\. ]{0,90})?"/> has been replaced
		with a newer pattern of: <xsd:pattern value="[0-9 ]{4}([A-Z ][0-9 ]{4}[A-Z ][a-zA-Z0-9:;&lt;=&gt;\?@%&amp;'\(\)\*\+,\-\. ]{0,90})?"/>
		This keeps the schema in line with previous guidance of padding the SAON and PAON for numbering and descriptions, as well as correcting
		the discrepancy of the original pattern forcing a minimum length of 5 characters as opposed to the CBDS 4.
		
		1.5 v1-0
		SAONtype and PAONtype pattern strings amended. Previously these were minimum length of 4, but the pattern string required a minimum length of 5.
		The original pattern 
		<xsd:pattern value="[0-9 ]{4}[A-Z ]([0-9 ]{4}[A-Z ][a-zA-Z0-9:;&lt;=&gt;\?@%&amp;'\(\)\*\+,\-\. ]{0,90})?"/> has been replaced with
		<xsd:pattern value="[0-9 ]{4}[A-Z]{0,1}([a-zA-Z0-9:;&lt;=&gt;\?@%&amp;'\(\)\*\+,\-\. ]{4,90})?"/>

	Changes 1.3 to 1.4
		Regular expression pattern restriction in PAON/SAON rewritten. This pattern expands the 0-Z and %-. constructs detailing allowed punctuation explicitly. Note
		that "<",">" and "&" are replaced by the relevant XML entity and "+", "-", "?","(",")" and "." are escaped with backslashes as they are reserved in regex syntax.
		Element StreetClosureDate made optional (minOccurs=0)
		Element name "UNIQUE_STREET_REFERENCE_NUMBERS" corrected to camel case
		Element Annotation made optional (minOccurs=0)
		Enumeration values for "RepresentativePointCodeType" extended to include 5 & 9
		Extend SAON/PAON content validation to include hyphen 

	Changes 1.2 to 1.3
	    PostCode pattern simplified because some parsers do not accept the complex pattern, this is backwardly compatible
		Pattern for "RefPointGridCoordinateType" changed from "/d{14}" to "[0-9]{14}" in order to conform to guidelines, this is backwardly compatible
		Easting Field pattern corrected to read 7 digits, aligned with Northing Field pattern that is also 7 digtis
	
	Changes 1.1 to 1.2:
		PostCode pattern brought in line with Data standards catalogue
		Metadata brought up to latest version of standard

	Changes 1.0 to 1.1:
		Postcode element changed to PostCode
		PostcodeType and PosttownType changed to PostCodeType and PostTownType
		PostCodeType pattern changed to match GDSC. The pattern has been relaxed slightly to not exclude [CIKMOV] in one part since testing found postcode with
		these patterns. It is still to be determined whether these are valid postcodes.
		StreetDescriptiveIdentifierStructure has been made unambiguous (deterministic)
-->
<xsd:schema xmlns="http://www.dcsf.gov.uk/schemas/cbds" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.dcsf.gov.uk/schemas/cbds" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.5" id="BS7666">
	<xsd:annotation>
		<xsd:appinfo xmlns:gms="http://www.govtalk.gov.uk/CM/gms">
			<Metadata xmlns="http://www.govtalk.gov.uk/CM/gms-xs">
				<Audience>e-service developers</Audience>
				<Contributor Role="Developer" Href="mailto:Iain.King@dcsf.gsi.gov.uk">Iain King</Contributor>
				<Contributor>Paul Spencer, Boynings Consulting  (mailto:paul.spencer@boynings.co.uk)</Contributor>
				<Contributor>e-champions,Government Schema Group, IDeA</Contributor>
				<Contributor>Adrian Kent, Office e-Envoy</Contributor>
				<Creator>Office of the e-Envoy (maito:govtalk@e-envoy.gsi.gov.uk </Creator>
				<Date>
					<Modified>2009-12-11</Modified>
					<Modified>2009-05-20</Modified>
					<Modified>2003-07-02</Modified>
					<Created>2003-02-11</Created>
				</Date>
				<Description>Schema for BS7666 definitions including addresses</Description>
				<Format>
					<MediaType>text/xml</MediaType>
					<Syntax>http://www.w3.org/2001/XMLSchema</Syntax>
					<Description>XML schema, W3C Recommendation 2001</Description>
				</Format>
				<Identifier>BS7666-v1-5</Identifier>
				<IsVersionOf>Copy-Of-bs7666-v1-5.xsd</IsVersionOf>
				<Language>[ISO 639-2/B] ENG</Language>
				<Publisher>Office of the e-Envoy, Stockley House,130 Wilton Road, London SW1V 1LQ</Publisher>
				<Rights>unclassified
					<Copyright>Crown copyright 2002, 2009</Copyright>
				</Rights>
				<Subject>
					<Category>People, communities and living</Category>
				</Subject>
				<Subject>
					<Project>UK GovTalk</Project>
				</Subject>
				<Title>BS7666 architectural schema</Title>
			</Metadata>
		</xsd:appinfo>
	</xsd:annotation>
	<xsd:annotation>
		<xsd:documentation>BS7666 is amended to include NEW SAON and PAON Definitions and Structure from BS7666v2.0. Also some definitions from Pupil CBDS 4.2 are incorporated.</xsd:documentation>
	</xsd:annotation>
	<!--_-_-_- _  Extra Definitions from CDBS 4.2  _-_-_-_-->
	<xsd:simpleType name="SAON_PAON_NumberType">
		<xsd:annotation>
			<xsd:documentation source="Pupil CBDS Version 4.2">Start (single) dwelling number
End dwelling number
</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:positiveInteger">
			<xsd:maxInclusive value="9999"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="SAON_PAON_SuffixType">
		<xsd:annotation>
			<xsd:documentation source="Pupil CBDS Version 4.2"/>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="1"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="AddressLineType">
		<xsd:annotation>
			<xsd:documentation source="Pupil CBDS Version 4.2">Address Lines [max length 40]</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="40"/>
			<xsd:minLength value="1"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="PostcodeCBDSType">
		<xsd:annotation>
			<xsd:documentation source="Pupil CBDS Version 4.2">Include pattern for PostCode and BFPO  enumeration.
 BFPO nnn PATTERN</xsd:documentation>
		</xsd:annotation>
		<xsd:union memberTypes="PostCodeType BFPOpostcodeType"/>
	</xsd:simpleType>
	<xsd:simpleType name="USRNcbdsType">
		<xsd:annotation>
			<xsd:documentation source="Pupil CBDS Version 4.2">12 digit - Unique Street Reference Number</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:positiveInteger">
			<xsd:maxInclusive value="999999999999"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="BFPOpostcodeType">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[B][F][P][O] [1-9][0-9]{0,2}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="EastingType">
		<xsd:annotation>
			<xsd:documentation source="Pupil CBDS Version 4.2">Easting coordinate for mapping an address</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:decimal">
			<xsd:totalDigits value="7"/>
			<xsd:fractionDigits value="1"/>
			<xsd:maxInclusive value="999999.9"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="NorthingType">
		<xsd:annotation>
			<xsd:documentation source="Pupil CBDS Version 4.2">Northing coordinate for mapping an address</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:decimal">
			<xsd:totalDigits value="7"/>
			<xsd:fractionDigits value="1"/>
			<xsd:maxInclusive value="999999.9"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="ZipType">
		<xsd:annotation>
			<xsd:documentation source="Pupil CBDS Version 4.2">International Postcode</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="20"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="InternationalPostCodeType">
		<xsd:annotation>
			<xsd:documentation source="Pupil CBDS Version 4.2">Postcode of International Address.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:token">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="35"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!--_-_-_- _ END Extra Definitions from CDBS 4.2  _-_-_-_-->
	<!--*_*_* Definitions from BS7666-2.0 *_*_*-->
	<xsd:simpleType name="AONdescriptionType">
		<xsd:annotation>
			<xsd:documentation>Restricted string type for the name text portion of the PAON and SAON</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="90"/>
			<xsd:pattern value="[a-zA-Z0-9:;&lt;=&gt;\?@%&amp;'\(\)\*\+,\-\. ]{0,90}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:complexType name="AONrangeStructure">
		<xsd:annotation>
			<xsd:documentation>Numeric and optional alpha suffix for start and end numbers</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="Number">
				<xsd:simpleType>
					<xsd:restriction base="xsd:positiveInteger">
						<xsd:maxInclusive value="9999"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="Suffix" minOccurs="0">
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:minLength value="1"/>
						<xsd:maxLength value="1"/>
						<xsd:pattern value="[A-Z]"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="AONstructure">
		<xsd:annotation>
			<xsd:documentation>Replacement for PAONtype and SAONtype</xsd:documentation>
		</xsd:annotation>
		<xsd:choice>
			<xsd:sequence>
				<xsd:element name="StartRange" type="AONrangeStructure"/>
				<xsd:element name="EndRange" type="AONrangeStructure" minOccurs="0"/>
				<xsd:element name="Description" type="AONdescriptionType" minOccurs="0"/>
			</xsd:sequence>
			<xsd:element name="Description" type="AONdescriptionType"/>
		</xsd:choice>
	</xsd:complexType>
	<!--*_*_* END Definitions from BS7666-2.0 *_*_*-->
	<xsd:complexType name="AddressBS7666CBDSstructure">
		<xsd:sequence>
			<xsd:element name="SAON" type="SAONtype" minOccurs="0"/>
			<xsd:element name="PAON" type="PAONtype"/>
			<xsd:element name="Street" type="StreetDescriptorType"/>
			<xsd:choice>
				<xsd:sequence>
					<xsd:element name="Locality" type="LocalityType"/>
					<xsd:choice minOccurs="0">
						<xsd:sequence>
							<xsd:element name="Town" type="TownType"/>
							<xsd:element name="AdministrativeArea" type="AdministrativeAreaType" minOccurs="0"/>
						</xsd:sequence>
						<xsd:element name="AdministrativeArea" type="AdministrativeAreaType"/>
					</xsd:choice>
				</xsd:sequence>
				<xsd:sequence>
					<xsd:element name="Town" type="TownType"/>
					<xsd:element name="AdministrativeArea" type="AdministrativeAreaType" minOccurs="0"/>
				</xsd:sequence>
				<xsd:element name="AdministrativeArea" type="AdministrativeAreaType"/>
			</xsd:choice>
			<xsd:element name="PostTown" type="PostTownType" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="AddressLinesCBDSstructure">
		<xsd:sequence>
			<xsd:element name="AddressLine1" type="AddressLineType"/>
			<xsd:element name="AddressLine2" type="AddressLineType"/>
			<xsd:element name="AddressLine3" type="AddressLineType" minOccurs="0"/>
			<xsd:element name="AddressLine4" type="AddressLineType" minOccurs="0"/>
			<xsd:element name="AddressLine5" type="AddressLineType" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="HomeInformationCBDSstructure">
		<xsd:sequence>
			<xsd:element name="PostCode" type="PostCodeType"/>
			<xsd:choice>
				<xsd:element name="BS7666Format" type="AddressBS7666CBDSstructure"/>
				<xsd:element name="LineAddressFormat" type="AddressLinesCBDSstructure"/>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:annotation>
		<xsd:documentation>--Amended by taking Elements out to avoid conflicts with elements within other schemas. Also target Namespace is changed to aviod conflict with other schemas.---- HGuram</xsd:documentation>
	</xsd:annotation>
	<!-- Basic BS7666 Compliant Address Element -->
	<xsd:complexType name="BSaddressStructure">
		<xsd:sequence>
			<xsd:element name="SAON" type="SAONtype" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>Secondary Addressable Object</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="PAON" type="PAONtype">
				<xsd:annotation>
					<xsd:documentation>Primary Addressable Object</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:sequence>
				<xsd:element name="StreetDescription" type="StreetDescriptorType"/>
				<xsd:element name="UniqueStreetReferenceNumber" type="USRNtype" minOccurs="0"/>
			</xsd:sequence>
			<xsd:choice>
				<xsd:sequence>
					<xsd:element name="Locality" type="LocalityType"/>
					<xsd:choice minOccurs="0">
						<xsd:sequence>
							<xsd:element name="Town" type="TownType"/>
							<xsd:element name="AdministrativeArea" type="AdministrativeAreaType" minOccurs="0"/>
						</xsd:sequence>
						<xsd:element name="AdministrativeArea" type="AdministrativeAreaType"/>
					</xsd:choice>
				</xsd:sequence>
				<xsd:sequence>
					<xsd:element name="Town" type="TownType"/>
					<xsd:element name="AdministrativeArea" type="AdministrativeAreaType" minOccurs="0"/>
				</xsd:sequence>
				<xsd:element name="AdministrativeArea" type="AdministrativeAreaType"/>
			</xsd:choice>
			<xsd:element name="PostTown" type="PostTownType" minOccurs="0"/>
			<xsd:element name="PostCode" type="PostCodeType" minOccurs="0"/>
			<xsd:element name="UniquePropertyReferenceNumber" type="UPRNtype" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- UPRN Definition as 2000-->
	<xsd:simpleType name="UPRNtype">
		<xsd:restriction base="xsd:integer">
			<xsd:minInclusive value="1"/>
			<xsd:maxInclusive value="999999999999"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- USRN Definition as 2000-->
	<xsd:simpleType name="USRNtype">
		<xsd:restriction base="xsd:integer">
			<xsd:minInclusive value="1"/>
			<xsd:maxInclusive value="99999999"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- PostCode Definition -->
	<xsd:simpleType name="PostCodeType">
		<xsd:annotation>
			<xsd:documentation>complex pattern for postcode, which matches definition, accepted by some parsers is: "(GIR 0AA)|((([A-Z-[QVX]][0-9][0-9]?)|(([A-Z-[QVX]][A-Z-[IJZ]][0-9][0-9]?)|(([A-Z-[QVX]][0-9][A-HJKSTUW])|([A-Z-[QVX]][A-Z-[IJZ]][0-9][ABEHMNPRVWXY])))) [0-9][A-Z-[CIKMOV]]{2})"</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][A-Z]{2}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- PAON Definition as 2000-->
	<xsd:simpleType name="PAONtype">
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="4"/>
			<xsd:pattern value="[0-9 ]{4}([a-zA-Z ][0-9 ]{4}[a-zA-Z ][a-zA-Z0-9:;&lt;=&gt;\?@%&amp;'\(\)\*\+,\-\. ]{0,90})?"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- SAON Definition as 2000-->
	<xsd:simpleType name="SAONtype">
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="4"/>
			<xsd:pattern value="[0-9 ]{4}([a-zA-Z ][0-9 ]{4}[a-zA-Z ][a-zA-Z0-9:;&lt;=&gt;\?@%&amp;'\(\)\*\+,\-\. ]{0,90})?"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Post Town Definition -->
	<xsd:simpleType name="PostTownType">
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="30"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Locality Definition as 2000-->
	<xsd:simpleType name="LocalityType">
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="35"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- AdministrativeArea Definition as 2000-->
	<xsd:simpleType name="AdministrativeAreaType">
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="30"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Town Definition as 2000-->
	<xsd:simpleType name="TownType">
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="30"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Street Descriptor as 2000-->
	<xsd:simpleType name="StreetDescriptorType">
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="100"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Street Reference Type Definition as 2000-->
	<xsd:simpleType name="StreetReferenceTypeType">
		<xsd:restriction base="xsd:integer">
			<xsd:enumeration value="1"/>
			<xsd:enumeration value="2"/>
			<xsd:enumeration value="3"/>
			<xsd:enumeration value="4"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Version Number Definition as 2000-->
	<xsd:simpleType name="VersionNumberType">
		<xsd:restriction base="xsd:positiveInteger">
			<xsd:minInclusive value="1"/>
			<xsd:maxInclusive value="9999"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Tolerance Definition as 2000-->
	<xsd:simpleType name="ToleranceType">
		<xsd:restriction base="xsd:decimal">
			<xsd:minInclusive value="0"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Reference Point Grid Coordinate Definition required for ESUs -->
	<xsd:simpleType name="RefPointGridCoordinateType">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[0-9]{14}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Type Definition For a BS7666 Street -->
	<xsd:complexType name="StreetStructure">
		<xsd:sequence>
			<xsd:element name="StreetReferenceType" type="StreetReferenceTypeType"/>
			<xsd:element name="StartCoordinate" type="CoordinateStructure"/>
			<xsd:element name="EndCoordinate" type="CoordinateStructure"/>
			<xsd:element name="Tolerance" type="ToleranceType"/>
			<xsd:element name="StreetVersionNumber" type="VersionNumberType"/>
			<xsd:element name="StreetEntryDate" type="xsd:date"/>
			<xsd:element name="StreetClosureDate" type="xsd:date" minOccurs="0"/>
			<xsd:element name="ResponsibleAuthority" type="CustodianCodeType"/>
			<xsd:element name="DescriptiveIdentifier" type="StreetDescriptiveIdentifierStructure"/>
			<xsd:element name="StreetAlias" type="StreetDescriptiveIdentifierStructure" minOccurs="0"/>
			<xsd:element name="StreetCrossReferences" minOccurs="0">
				<xsd:complexType>
					<xsd:choice>
						<xsd:element name="UniqueStreetReferenceNumbers" type="USRNlistType"/>
						<xsd:element name="ElementaryStreetUnit" type="ElementaryStreetUnitStructure" minOccurs="0" maxOccurs="unbounded"/>
					</xsd:choice>
				</xsd:complexType>
			</xsd:element>
		</xsd:sequence>
		<xsd:attribute name="usrn" type="USRNtype"/>
	</xsd:complexType>
	<!-- Type Definition For a Street Descriptive Identifier 
		 New Construct, contains the street description and
		 at least one of Town, AdministrativeArea or Locality
	 -->
	<xsd:complexType name="StreetDescriptiveIdentifierStructure">
		<xsd:sequence>
			<xsd:element name="StreetDescription" type="StreetDescriptorType"/>
			<xsd:choice>
				<xsd:sequence>
					<xsd:element name="Locality" type="LocalityType"/>
					<xsd:choice minOccurs="0">
						<xsd:sequence>
							<xsd:element name="Town" type="TownType"/>
							<xsd:element name="AdministrativeArea" type="AdministrativeAreaType" minOccurs="0"/>
						</xsd:sequence>
						<xsd:element name="AdministrativeArea" type="AdministrativeAreaType"/>
					</xsd:choice>
				</xsd:sequence>
				<xsd:sequence>
					<xsd:element name="Town" type="TownType"/>
					<xsd:element name="AdministrativeArea" type="AdministrativeAreaType" minOccurs="0"/>
				</xsd:sequence>
				<xsd:element name="AdministrativeArea" type="AdministrativeAreaType"/>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
	<!-- BS7666 Elementary Street Unit -->
	<xsd:complexType name="ElementaryStreetUnitStructure">
		<xsd:sequence>
			<xsd:element name="ESUidentity" type="RefPointGridCoordinateType"/>
			<xsd:element name="ESUversion" type="VersionNumberType"/>
			<xsd:element name="ESUentryDate" type="xsd:date"/>
			<xsd:element name="ESUclosureDate" type="xsd:date" minOccurs="0"/>
			<xsd:element name="StartCoordinate" type="CoordinateStructure"/>
			<xsd:element name="EndCoordinate" type="CoordinateStructure"/>
			<xsd:element name="Tolerance" type="ToleranceType"/>
			<xsd:element name="IntermediateCoord" type="CoordinateStructure" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- Coordinate Definition -->
	<xsd:complexType name="CoordinateStructure">
		<xsd:annotation>
			<xsd:documentation>Coordinate Point based on UK National Grid</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="X">
				<xsd:annotation>
					<xsd:documentation>Easting Field</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:unsignedLong">
						<xsd:minInclusive value="0"/>
						<xsd:maxInclusive value="9999999"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="Y">
				<xsd:annotation>
					<xsd:documentation>Northing Field</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:unsignedLong">
						<xsd:minInclusive value="0"/>
						<xsd:maxInclusive value="9999999"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<!-- Type Definition for a list or UPRN's -->
	<xsd:simpleType name="UPRNlistType">
		<xsd:list itemType="UPRNtype"/>
	</xsd:simpleType>
	<!-- Type Definition for a list or USRN's -->
	<xsd:simpleType name="USRNlistType">
		<xsd:list itemType="USRNtype"/>
	</xsd:simpleType>
	<!-- Polygon representing the extent of a BLPU.   -->
	<xsd:complexType name="BLPUpolygonStructure">
		<xsd:sequence>
			<xsd:element name="PolygonID">
				<xsd:simpleType>
					<xsd:restriction base="xsd:positiveInteger">
						<xsd:minInclusive value="1"/>
						<xsd:maxInclusive value="99"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="PolygonType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>H to represent a hole or not present</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:enumeration value="H"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:choice>
				<xsd:element name="Vertices" type="CoordinateStructure" minOccurs="3" maxOccurs="unbounded"/>
				<xsd:element name="ExternalRef" type="xsd:unsignedLong"/>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
	<!-- The Extent of a BLPU - expressed either as one or more polygons or external references -->
	<xsd:complexType name="BLPUextentStructure">
		<xsd:sequence>
			<xsd:element name="SourceDescription">
				<xsd:annotation>
					<xsd:documentation>Description of Source of BLPU Extent</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:minLength value="1"/>
						<xsd:maxLength value="50"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="ExtentEntryDate" type="xsd:date"/>
			<xsd:element name="ExtentSourceDate" type="xsd:date"/>
			<xsd:element name="ExtentStartDate" type="xsd:date"/>
			<xsd:element name="ExtentEndDate" type="xsd:date" minOccurs="0"/>
			<xsd:element name="ExtentLastUpdateDate" type="xsd:date"/>
			<xsd:element name="ExtentDefinition" type="BLPUpolygonStructure" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- BS7666 Provenance Code -->
	<xsd:simpleType name="ProvenanceCodeType">
		<xsd:annotation>
			<xsd:documentation>Provenance Code values
					T = Registered land title
					L = Unregistered land title
					F = Formal tenancy agreement
					R = Rental agreement
					P = Physical features
					O = Occupancy
					U = Use</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="T"/>
			<xsd:enumeration value="L"/>
			<xsd:enumeration value="F"/>
			<xsd:enumeration value="R"/>
			<xsd:enumeration value="P"/>
			<xsd:enumeration value="O"/>
			<xsd:enumeration value="U"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- BS7666 Provenance for a BLPU -->
	<xsd:complexType name="ProvenanceStructure">
		<xsd:sequence>
			<xsd:element name="ProvenanceCode" type="ProvenanceCodeType"/>
			<xsd:element name="Annotation" type="xsd:string" minOccurs="0"/>
			<xsd:element name="ProvEntryDate" type="xsd:date"/>
			<xsd:element name="ProvStartDate" type="xsd:date"/>
			<xsd:element name="ProvEndDate" type="xsd:date" minOccurs="0"/>
			<xsd:element name="ProvLastUpdateDate" type="xsd:date"/>
			<xsd:element name="BLPUextent" type="BLPUextentStructure" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- Custodian Code - 4 digit code identifier for a particular local authority or other custodian -->
	<xsd:simpleType name="CustodianCodeType">
		<xsd:restriction base="xsd:integer">
			<xsd:minInclusive value="1"/>
			<xsd:maxInclusive value="9999"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Representative Point Code -->
	<xsd:simpleType name="RepresentativePointCodeType">
		<xsd:annotation>
			<xsd:documentation>Representative Point Code values
					1 = Visual centre
					2 = General internal point
					3 = South-west corner of 100m grid square
					4 = Start point of the referenced street</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:positiveInteger">
			<xsd:enumeration value="1"/>
			<xsd:enumeration value="2"/>
			<xsd:enumeration value="3"/>
			<xsd:enumeration value="4"/>
			<xsd:enumeration value="5"/>
			<xsd:enumeration value="9"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Logical Status for an LPI and BLPU-->
	<xsd:simpleType name="LogicalStatusType">
		<xsd:annotation>
			<xsd:documentation>Logical Status values
					1 = Approved preferred
					2 = Approved alternative (LPI Only)
					3 = Alternative (LPI Only)
					5 = Candidate
					6 = Provisional
					8 = Historical
					9 = Rejected</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:integer">
			<xsd:minInclusive value="1"/>
			<xsd:maxInclusive value="9"/>
			<xsd:enumeration value="1"/>
			<xsd:enumeration value="2"/>
			<xsd:enumeration value="3"/>
			<xsd:enumeration value="5"/>
			<xsd:enumeration value="6"/>
			<xsd:enumeration value="8"/>
			<xsd:enumeration value="9"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- 2000 - Basic Land And Property Unit -->
	<xsd:complexType name="BasicLandAndPropertyUnitStructure">
		<xsd:sequence>
			<xsd:element name="UniquePropertyReferenceNumber"/>
			<xsd:element name="CustodianCode" type="CustodianCodeType"/>
			<xsd:element name="RepresentativePointCode" type="RepresentativePointCodeType"/>
			<xsd:element name="LogicalStatus" type="LogicalStatusType"/>
			<xsd:element name="GridReference" type="CoordinateStructure"/>
			<xsd:element name="BLPUentryDate" type="xsd:date"/>
			<xsd:element name="BLPUstartDate" type="xsd:date"/>
			<xsd:element name="BLPUendDate" type="xsd:date" minOccurs="0"/>
			<xsd:element name="BLPUlastUpdateDate" type="xsd:date"/>
			<xsd:element name="LandAndPropertyIdentifier" type="LandAndPropertyIdentifierStructure" maxOccurs="unbounded"/>
			<xsd:element name="Provenance" type="ProvenanceStructure" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- 2000 - Land and Property Identifier -->
	<xsd:complexType name="LandAndPropertyIdentifierStructure">
		<xsd:sequence>
			<xsd:element name="PAON" type="PAONtype"/>
			<xsd:element name="SAON" type="SAONtype" minOccurs="0"/>
			<xsd:element name="PostTown" type="PostTownType" minOccurs="0"/>
			<xsd:element name="PostCode" type="PostCodeType" minOccurs="0"/>
			<xsd:element name="Level" minOccurs="0">
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:minLength value="1"/>
						<xsd:maxLength value="30"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="LogicalStatus" type="LogicalStatusType"/>
			<xsd:element name="OfficialAddressMarker" type="xsd:boolean" minOccurs="0"/>
			<xsd:element name="LPIstartDate" type="xsd:date"/>
			<xsd:element name="LPIentryDate" type="xsd:date"/>
			<xsd:element name="LPIendDate" type="xsd:date" minOccurs="0"/>
			<xsd:element name="LPIlastUpdateDate" type="xsd:date"/>
			<xsd:choice>
				<xsd:element name="Street" type="StreetStructure"/>
				<xsd:element name="USRN" type="USRNtype"/>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>
