<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.minfin.fgov.be/RtnList" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.minfin.fgov.be/RtnList" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:annotation>
		<xs:documentation xml:lang="en"><![CDATA[
			A schema for the definition of messages to be returned by the Intervat application. 
			=== HISTORY===
			Version 1.3
				- Modification du tag RtnList : modification des attributs AgentId (de 14 chars à chars), ReturnRef (de 14 numériques vers string optionel), Name (de 50 à 200 chars), Street (de 100 à 200 chars) et CityAndZipCode (de 116 à 200 chars)

				- DeclarantCtrl
					- Modification du tag VatNumber : (de '0' + 9 numériques à 10 numériques) numéro de TVA de l'assujetti en 10 positions
					- Modification de la longueur du tag Name (de 50 à 200 chars), Street (de 100 à 200 chars) et CityAndZipCode (de 116 à 200 chars)
		]]></xs:documentation>
	</xs:annotation>

	<!-- Attributes group definition-->
	<xs:attributeGroup name="RtnListAttributes">
		<xs:attribute name="TypeDtd" use="required">
			<xs:annotation>
				<xs:documentation>The role of this attribute is to show the scheme that has been used.</xs:documentation>
				<xs:documentation xml:lang="fr"></xs:documentation>
				<xs:documentation xml:lang="nl"></xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string"/>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="SenderId" use="required">
			<xs:annotation>
				<xs:documentation>This identification is for the sender is the administration of the VAT. The identifier is 'VAT-ADMIN'.</xs:documentation>
				<xs:documentation xml:lang="fr"></xs:documentation>
				<xs:documentation xml:lang="nl"></xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:enumeration value="VAT-ADMIN"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="SenderRef" use="required">
			<xs:annotation>
				<xs:documentation>This is the reference number attributed by the FPS Finances.</xs:documentation>
				<xs:documentation xml:lang="fr">Le numéro de référence attribué par le S.P.F. Finances</xs:documentation>
				<xs:documentation xml:lang="nl">Het door FOD Financiën toegekende refertenummer</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:unsignedLong">
					<xs:totalDigits value="9"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="AgentId" use="required">
			<xs:annotation>
				<xs:documentation>This is the representative agent identified in the message received by Intervat. This is the country + VAT number of the agent (for belgium and foreign deposant).</xs:documentation>
				<xs:documentation xml:lang="fr"></xs:documentation>
				<xs:documentation xml:lang="nl"></xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string" />
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="ReturnRef" use="optional" type="xs:string">
			<xs:annotation>
				<xs:documentation>This is the unique reference number assigned by to the recapitulative statement. It is the attribute ControlRef of input XML file. In case of a screen declaration, the content will be empty</xs:documentation>
				<xs:documentation xml:lang="fr"></xs:documentation>
				<xs:documentation xml:lang="nl"></xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="SenderDate" use="required">
			<xs:annotation>
				<xs:documentation>This is the date when the message was prepared following the format CCYY-MM-DD</xs:documentation>
				<xs:documentation xml:lang="fr"></xs:documentation>
				<xs:documentation xml:lang="nl"></xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:date"/>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="Test" type="xs:boolean" use="optional">
			<xs:annotation>
				<xs:documentation>Test Indicator</xs:documentation>
				<xs:documentation xml:lang="fr"></xs:documentation>
				<xs:documentation xml:lang="nl"></xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="Name" use="optional">
			<xs:annotation>
				<xs:documentation>Name of the representative agent</xs:documentation>
				<xs:documentation xml:lang="fr"></xs:documentation>
				<xs:documentation xml:lang="nl"></xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:maxLength value="200"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="Street" use="optional">
			<xs:annotation>
				<xs:documentation>Address of the representative agent</xs:documentation>
				<xs:documentation xml:lang="fr"></xs:documentation>
				<xs:documentation xml:lang="nl"></xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:maxLength value="200"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="CityAndZipCode" use="optional">
			<xs:annotation>
				<xs:documentation>City and Zip/ Postal code of the representative agent</xs:documentation>
				<xs:documentation xml:lang="fr"></xs:documentation>
				<xs:documentation xml:lang="nl"></xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:maxLength value="200"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="Country" use="optional">
			<xs:annotation>
				<xs:documentation>Country code of the address (ISO 3166-1 alpha-2) of the representative agent</xs:documentation>
				<xs:documentation xml:lang="fr">Code pays de l'adresse (ISO 3166-1 alpha-2) de l'agent représentant</xs:documentation>
				<xs:documentation xml:lang="nl">Landcode van het adres (ISO 3166-1 alpha-2)</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:length value="2"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:attributeGroup>
	<!-- Element definition:-->
	<xs:element name="Result">
		<xs:annotation>
			<xs:documentation>This element contains  the text of the result and its code.</xs:documentation>
			<xs:documentation xml:lang="fr"></xs:documentation>
			<xs:documentation xml:lang="nl"></xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:string">
					<xs:attribute name="Code" type="xs:unsignedShort" use="required">
						<xs:annotation>
							<xs:documentation>The code take the number of the error</xs:documentation>
							<xs:documentation xml:lang="fr"></xs:documentation>
							<xs:documentation xml:lang="nl"></xs:documentation>
						</xs:annotation>
					</xs:attribute>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="DeclarantCtrl">
		<xs:annotation>
			<xs:documentation>Element takes the errors for each declaration and the checksum</xs:documentation>
			<xs:documentation xml:lang="fr"></xs:documentation>
			<xs:documentation xml:lang="nl"></xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="Result" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="SequenceNum" type="xs:positiveInteger" use="required">
				<xs:annotation>
					<xs:documentation>Sequential number for the declaration</xs:documentation>
					<xs:documentation xml:lang="fr"></xs:documentation>
					<xs:documentation xml:lang="nl"></xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="VatNumber" use="required">
				<xs:annotation>
					<xs:documentation>This is the VAT number of the subject in 10 positions.</xs:documentation>
					<xs:documentation xml:lang="fr">numéro de TVA de l'assujetti en 10 positions</xs:documentation>
					<xs:documentation xml:lang="nl">BTW nummer van de belastingplichtige in 10 posities</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:length value="10"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="DeclarantNum" use="required">
				<xs:annotation>
					<xs:documentation>This is the unique reference number assigned by the sender to the declaration.</xs:documentation>
					<xs:documentation xml:lang="fr"></xs:documentation>
					<xs:documentation xml:lang="nl"></xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:nonNegativeInteger">
						<xs:totalDigits value="19"/>
						<xs:pattern value="\d{19}"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="Name" use="optional">
				<xs:annotation>
					<xs:documentation>Name</xs:documentation>
					<xs:documentation xml:lang="fr">Nom de l'assujetti</xs:documentation>
					<xs:documentation xml:lang="nl"></xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="200"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="Street" use="optional">
				<xs:annotation>
					<xs:documentation>Address</xs:documentation>
					<xs:documentation xml:lang="fr">Adresse de l'assujetti</xs:documentation>
					<xs:documentation xml:lang="nl"></xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="200"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="CityAndZipCode" use="optional">
				<xs:annotation>
					<xs:documentation>City and Zip/ Postal code</xs:documentation>
					<xs:documentation xml:lang="fr">Localité et Code postal de l'assujetti</xs:documentation>
					<xs:documentation xml:lang="nl"></xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="200"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="Country" use="optional">
				<xs:annotation>
					<xs:documentation>Country code of the address (ISO 3166-1 alpha-2)</xs:documentation>
					<xs:documentation xml:lang="fr">Code pays de l'adresse (ISO 3166-1 alpha-2)</xs:documentation>
					<xs:documentation xml:lang="nl">Landcode van het adres (ISO 3166-1 alpha-2)</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:length value="2"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="EnvoiCtrl">
		<xs:annotation>
			<xs:documentation>Element takes the errors for the complete document</xs:documentation>
			<xs:documentation xml:lang="fr"></xs:documentation>
			<xs:documentation xml:lang="nl"></xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="Result" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="RtnList">
		<xs:annotation>
			<xs:documentation>Root element of the Xml file return for recapitulative statement</xs:documentation>
			<xs:documentation xml:lang="fr"></xs:documentation>
			<xs:documentation xml:lang="nl"></xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="EnvoiCtrl"/>
				<xs:element ref="DeclarantCtrl" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attributeGroup ref="RtnListAttributes"/>
		</xs:complexType>
	</xs:element>
</xs:schema>
