<?xml version="1.0" standalone="yes" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="employerReturnSocSec2006" version="1.5">
	<xsd:annotation>
		<xsd:documentation xml:lang="en">Employer Soc Sec Returns Schema from year 2006.</xsd:documentation>
	</xsd:annotation>
	<!--
		Root Element for Electronic Employer Soc Sec Returns
	-->
	<xsd:element name="employerReturnSocSec" type="employerReturnSocSecType" />
	<!--
		Definition of employerReturnSocSec type
	-->
	<xsd:complexType name="employerReturnSocSecType">
		<xsd:sequence>
			<!-- Date File Written -->
			<xsd:element name="dateFilWri" type="xsd:date" />
			<!-- Details per Employer -->
			<xsd:element name="employersHeader" type="employersHeaderType" minOccurs="1" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>
	<!--
		Employer Header 
	-->
	<xsd:complexType name="employersHeaderType"> 
		<xsd:sequence>
			<!-- Employees Header -->
			<xsd:element name="employeesHeader" type="employeesHeaderType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
		<!-- Employer Code -->
		<xsd:attribute name="emplCode" type="emplCodeType" use="required" />
		<!-- Calendar Year -->
		<xsd:attribute name="calendarYear" type="xsd:gYear" use="required" />
		<!-- Quarter -->
		<xsd:attribute name="quarterCode" type="quarterCodeType" use="required" />
		<!-- Month in Quarter -->
		<xsd:attribute name="quarterMonth" type="quarterMonthType" use="required" />
	</xsd:complexType>
	<!--
		Employees Header
	-->
	<xsd:complexType name="employeesHeaderType">
		<xsd:sequence>
			<!-- Employee Surname -->
			<xsd:element name="empeSurNam" type="string30" />
			<!-- Employee Social Security Code -->
			<xsd:element name="empeSocSec" type="socSecType" minOccurs="0"/>
			<!-- Employee Earnings Month -->
			<xsd:element name="empeEarn" type="xsd:integer" />
			<!-- Employee Left Island -->
			<xsd:element name="empeLeft" type="ynType" minOccurs="0" />
			<!-- Employment Periods -->
			<xsd:element name="empePeriod" minOccurs="0" maxOccurs="unbounded">
				<xsd:complexType>
					<xsd:sequence>
						<!-- Date Employment Started -->
						<xsd:element name="empeDatSt" type="xsd:date" minOccurs="0" />
						<!-- Date Employment Ended -->
						<xsd:element name="empeDatEn" type="xsd:date" minOccurs="0" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
		Simple Data Type Definitions 
	-->
	<xsd:simpleType name="emplCodeType">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[A-Z,0-9]{1}[0-9]{4}" />
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="socSecType">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[A-Z]{2}[0-9]{6}[A-Z]{0,1}" />
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="quarterCodeType">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[A,B,C,D]{1}" />
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="quarterMonthType">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[1,2,3]{1}" />
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="ynType">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[Y,N]{1}" />
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="string30">
		<xsd:restriction base="string">
			<xsd:maxLength value="30" />
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="string">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="\p{IsBasicLatin}*" />
		</xsd:restriction>
	</xsd:simpleType>
</xsd:schema>
