<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2011 rel. 2 sp1 (http://www.altova.com) by smals (SMALS-MVM ASBL/VZW) -->
<!--
	1 - Certaines informations (code enregistrement, euro) ne sont plus utile d'un point de vue fonctionnel mais ils ont été 
         maintenus pour raison de facilité et de rapidité de mise en oeuvre. Ceci permet de modifier le moins possible le 		circuit 
         aval de la liste de répartition
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:annotation>
		<xs:documentation xml:lang="en">Schema Definition used by Social Secretariat to send Repartition List via SMALS's stream tools (SP7) </xs:documentation>
	</xs:annotation>
	<xs:element name="RepartitionList">
		<xs:annotation>
			<xs:documentation xml:lang="en">
				  Root Element. Many occurences within one Xml file is allowed
			  </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="SocialSecretariat" type="SocialSecretariat" minOccurs="1" maxOccurs="unbounded"/>
				<xs:element name="TotalList" type="Total" minOccurs="1" maxOccurs="1">
					<xs:annotation>
						<xs:documentation>Total of the list</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="Nature" use="required">
				<xs:annotation>
					<xs:documentation xml:lang="en">Choices, 1 : Provision - 2 : Balance Quarter - 3 : Vacation - 9 : Total</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:integer">
						<xs:pattern value="[1239]"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="CreationDate" use="required">
				<xs:annotation>
					<xs:documentation xml:lang="en">JJMMSSAA (8 DIGIT fixed)  --  JJ : day of the month  -- DD : month of the year  -- SS : century (19 or 20) -- AA : year</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:integer">
						<xs:pattern value="[0123][0-9][01][0-9][0-6][0-9][0-9][0-9]"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="Devise" use="required">
				<xs:annotation>
					<xs:documentation xml:lang="en">Always EUR. Needed for facility purpose.</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="EUR"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="SocialSecretariat">
		<xs:annotation>
			<xs:documentation xml:lang="en">This can occur one or many time within a list.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Employer" type="Employer" minOccurs="1" maxOccurs="unbounded"/>
			<xs:element name="TotalSocialSecretariat" type="Total" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Total of all employers of a Social Secretariat</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="Denomination" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Denomination of the Social Secretariat (Max. Lenght is 48 char.)</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:maxLength value="48"/>
					<xs:minLength value="2"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="Number" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Social Secretariat or Branch Number (3 Digits)</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:pattern value="[0-9][0-9][0-9]"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="ControlNumber" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Control Number  (2 Digits)</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:pattern value="[0-9][0-9]"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	<!-- Employeur  -->
	<xs:complexType name="Employer">
		<xs:annotation>
			<xs:documentation xml:lang="en">This can occur one or many time within a Social Secretariat</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Payment" type="Payment" minOccurs="1" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="CompanyID" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Enterprise Number on 10 Digits OR "0" if unknown</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:union memberTypes="KnownCompanyID UnknownCompanyID"/>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="NOSSRegsitrationNbr" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">8 Digits Number + 2 Digit Control Number</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:pattern value="[0-9]{10}"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="Denomination" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Denomination of the Employer</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:maxLength value="96"/>
					<xs:minLength value="2"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	<!-- Versement -->
	<xs:complexType name="Payment">
		<xs:attribute name="PaymentDate" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">JJMMSSAA (8 DIGIT fixed)  --  JJ : day of the month  -- DD : month of the year  -- SS : century (19 or 20) -- AA : year</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:pattern value="[0123][0-9][01][0-9][0-6][0-9][0-9][0-9]"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="AccountingClass" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">JJMMSSAA (8 DIGIT fixed)  --  JJ : day of the month  -- DD : month of the year  -- SS : century (19 or 20) -- AA : year</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:pattern value="[0-9]{3}"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="Quarter0KSSA" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">"0" -- K = 0,1,2,3 ou 4 -- SS : Century (19 or 20) -- AA : Year</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:pattern value="0[01234][12][09][0-9][0-9]"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="Reference" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">4 Digit Number</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:pattern value="[0-9][0-9][0-9][0-9]"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="Amount" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Expressed in EUROCENT</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="14"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="DossierNumber" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">8 Digit Number</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="8"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="PageNumber" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Page Number</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="4"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="ColumnNumber" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">1 : Delay or Provision -- 2 : Outside of the delay -- 3 : Outside of the delay -- 4 : Outside of the delay </xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:pattern value="[1234]"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="LineNumber" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">2 Digit Number</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="2"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	<!-- Total -->
	<xs:complexType name="Total">
		<xs:attribute name="TotalItem" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Number of items concerned by the total (List or Social Secretariat)</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="5"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="SumCompanyID" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Sum of all CompanyID concerned by the total (List or Social Secretariat)</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="20"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="SumNOSSRegsitrationNbr" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Sum of all NOSSRegsitrationNbr (without control number) concerned by the total (List or Social Secretariat)</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="13"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="TotalAmount" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Total amount of the current items in EUROCENT (List or Social Secretariat)</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="20"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="TotalPaymentCol1" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Total items with ColumnNumber = 1</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="5"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="TotalPaymentCol2" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Total items with ColumnNumber = 2</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="5"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="TotalPaymentCol3" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Total items with ColumnNumber = 3</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="5"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="TotalPaymentCol4" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Total items with ColumnNumber = 4</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="5"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="TotalAmountPaymentCol1" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Total amount of items with ColumnNumber = 1</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="20"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="TotalAmountPaymentCol2" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Total amount of items with ColumnNumber = 2</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="20"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="TotalAmountPaymentCol3" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Total amount of items with ColumnNumber = 3</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="20"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="TotalAmountPaymentCol4" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">Total amount of items with ColumnNumber = 4</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:totalDigits value="20"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	<!--Sous-type-->
	<xs:simpleType name="KnownCompanyID">
		<xs:restriction base="xs:integer">
			<xs:pattern value="[0-9]{10}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="UnknownCompanyID">
		<xs:restriction base="xs:integer">
			<xs:pattern value="[0]"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
