<?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) -->
<!--
	Changes 1.0 to 2.0
		Metadata updated and consequently NameSpace changed to reflect change in department's name,
		file Name changed to UPNtype-v2.0.xsd
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.dcsf.gov.uk/schemas/cbds" targetNamespace="http://www.dcsf.gov.uk/schemas/cbds" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0" id="UPNtype">
	<xs:annotation>
		<xs:appinfo>
			<Metadata xmlns="http://www.govtalk.gov.uk/CM/gms-xs">
				<Contributor Role="Developer" Href="mailto:Iain.King@dcsf.gsi.gov.uk">Iain King</Contributor>
				<Contributor Role="DSG Helpdesk" Href="mailto:DSG.HELPDESK@DCSF.GSI.Gov.UK">DCSF - DSG (D1)</Contributor>
				<Creator>DSG D2 : CBDS and NRWS, Department for Children, Schools and Families</Creator>
				<Date>
					<Modified>2009-05-20</Modified>
					<Modified>2007-09-14</Modified>
					<Modified>2006-02-09</Modified>
					<Created>2001-12-19</Created>
					<Issued/>
				</Date>
				<Format Scheme="http://www.iana.org/assignments/media-types/">text/xml</Format>
				<Identifier>UPNtype</Identifier>
				<Publisher>Department for Children, Schools and Families, Sanctuary Buildings, Great Smith Street, London  SW1P 3BT</Publisher>
				<Relation>
					<ConformsTo>http://www.w3.org/2001/XMLSchema</ConformsTo>
					<IsVersionOf>UPNtype.xsd</IsVersionOf>
					<IsPartOf>CBDS Schemas</IsPartOf>
					<ProvidesDefinitionOf>UniquePupilNumberType</ProvidesDefinitionOf>
					<ProvidesDefinitionOf>TemporaryUniquePupilNumberType</ProvidesDefinitionOf>
					<ProvidesDefinitionOf>UPNtype</ProvidesDefinitionOf>
					<ProvidesDefinitionOf>TemporaryUPNtype</ProvidesDefinitionOf>
					<ProvidesDefinitionOf>EitherUPNtype</ProvidesDefinitionOf>
				</Relation>
				<Status>
					<Status>release</Status>
					<Description>May release for 2009</Description>
					<Version>2.0</Version>
				</Status>
				<Subject>
					<Project>CBDS</Project>
					<Category>Schools Education</Category>
					<Category>Pupil</Category>
				</Subject>
				<Title>Unique Pupil Number (UPN) type</Title>
				<Type>architectural</Type>
				<Description>Provides definition of UPN and Temporary UPN</Description>
				<Language>eng</Language>
				<Rights>
					<Copyright>Crown Copyright 2003 - 2009</Copyright>
					<ProtectiveMarking>Unclassified</ProtectiveMarking>
				</Rights>
			</Metadata>
		</xs:appinfo>
	</xs:annotation>
	<xs:simpleType name="UniquePupilNumberType">
		<xs:annotation>
			<xs:documentation>
A unique pupil number (UPN) is allocated to each child in an English state school.  
It is an identifier for use in the educational context during a child's school career only and subject to Data Protection restrictions.  
It consists of an upper-case check letterfollowed by twelve numeric digits.  
The check letter at position 1 is found by calculating the modulo 23 sum of digit*position over the 12 numeric digits.
The position of the first numeric digit in the calculation is 2. 
The resulting value is replaced by a letter of the alphabet following the rule:  0->A, 1->B, 2->C, ......... 22->Z (I, O and S are not used)
The components of the twelve digit number are, from left to right: 
a government-allocated Local Education Authority number (four digits); 
a School number (three digits); the last two digits of an academic year; three random digits.  
The first two components may be checked for validity by an application but should not be considered to yield usable data.
(See separate schemas for Local Authority and School numbers.)
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="[A-HJ-NP-RT-Z][0-9]{12}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="TemporaryUniquePupilNumberType">
		<xs:annotation>
			<xs:documentation>
A temporary UPN is issued to a child whose previously allocated UPN is, for the moment, not known.  
It will be replaced by the previously allocated UPN when such is discovered.
The format of a temporary UPN is as for a normal UPN, except that the last position is filled by an uppercase alpha character.  
In calculating the check letter the last character is replaced by a numeric value following the rule: A->0, B->1, C->2, ......... Z->22 (I, O and S are not used)
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="[A-HJ-NP-RT-Z][0-9]{11}[A-HJ-NP-RT-Z]"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="UPNtype">
		<xs:annotation>
			<xs:documentation>
UPN is a widely-used and understood abbreviation in the education workd for Unique Pupil Number so this type is offered for convenience.	
		</xs:documentation>
		</xs:annotation>
		<xs:union memberTypes="UniquePupilNumberType"/>
	</xs:simpleType>
	<xs:simpleType name="TemporaryUPNtype">
		<xs:annotation>
			<xs:documentation>
UPN is a widely-used and understood abbreviation in the education workd for Unique Pupil Number so this type is offered for convenience.	
		</xs:documentation>
		</xs:annotation>
		<xs:union memberTypes="TemporaryUniquePupilNumberType"/>
	</xs:simpleType>
	<xs:simpleType name="EitherUPNtype">
		<xs:annotation>
			<xs:documentation>
This type is used whenever a permanent or temporary UPN is allowable (as is generally the case).
		</xs:documentation>
		</xs:annotation>
		<xs:union memberTypes="TemporaryUniquePupilNumberType UniquePupilNumberType"/>
	</xs:simpleType>
</xs:schema>
