<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2006 U (http://www.altova.com) by BE06198 (EMBRACE) -->
<!-- =====================================================================
	* File Name             : LotPackageVoucher_20090716.xsd
	* Author                  :  Robert Van Craen
	* Owner                  :  CBSS 
	* Domain					: Batch - External
	* Creation date        : 2009/07/16
	* Last revision date : 2012/12/12
									approved by Alain Tilmant and Peter Van Den Bosch
	* Description           :  This xsd declares all objects that are specific to create a descriptive voucher for the exchange of lot message files.
	* Status                   : Model 
	* Current Version    : 20090716
	* Revision History   : 2009/12/07 - RVC
									 Extended the application code type list and moved to the metadata segment
									 Changed the file naming conventions following, using a character to mark a file name element 
									 Changed the name of the timeIndicator into mileStone
									 Added the notify type and element
									 Removed the lotIdentifier element from the packagedLotFile type
									 Renamed voucherIdentifier into uniqueIdentifier
									 Added SOCTAR application type and A1, Unknown syntax types
									 Added operationCode field
						 : 2010/06/10 - JVG
						 			 Added extra application types
						 			 Added optional number field for the data files
						 : 2010/07/12 - TAE
						 			 Added application type for caddis
						:	2010/08/16 - BST
									Added application type for lars
						:	2010/08/23 - BST
									Added application types BuildInH and EPV
						:	2010/08/26 - BST
									Corrected documentation of voucherName element: direction field must have value f for partner to CBSS and value t for CBSS to partner
						:	2010/09/07 - BST
									Added CSV Syntax and application code ChildBenefit.
						:	2010/12/08 - PVdB
									Correct application type enumeration: PMR => PRM
						:	2010/12/10 - BST
									Added application code DB2P.
						:	2010/12/08 - TomA
									Removed enumeration for application code types.
						:	2011/08/01 - PVdB
									FileSequenceNumber => fileSequenceNumber
							2012/12/10 - TomW
									Add maximum length in definition of following fields in the voucher xsd:
									voucherName: max length 100
									uniqueIdentifier: max length 65
									mileStone: max length 8
									applicationCode: max length 50
									operationCode: max length 50
									fileSequenceNumber: max length 15, 
																	also a positive integer not a string.

									Change documentation for fileSequenceNumber in voucher xsd:
									'This sequence is increased for each file across vouchers' should be replaced by 'This sequence is increased for each file within a voucher'
	========================================================================= -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://kszbcss.fgov.be/types/Batch/External/LotPackageVoucherObjects/20090716" targetNamespace="http://kszbcss.fgov.be/types/Batch/External/LotPackageVoucherObjects/20090716" elementFormDefault="unqualified" attributeFormDefault="unqualified">
	<!-- Start definition of the elements -->
	<xsd:element name="lotPackageVoucher" type="tns:LotPackageVoucherType">
		<xsd:annotation>
			<xsd:documentation>The root element to use when creating a lot package voucher structure</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<!-- End definition of the elements -->
	<!-- Start definition of the simple types -->
	<xsd:simpleType name="EnvironmentType">
		<xsd:annotation>
			<xsd:documentation>A list of environments for which the voucher and the lot files can be intended to</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="T"/>
			<xsd:enumeration value="A"/>
			<xsd:enumeration value="P"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="ApplicationCodeType">
		<xsd:annotation>
			<xsd:documentation>A list of application codes for which the messages in a lot file can be intended to. Values are determined in agreement with the partner.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string"/>
	</xsd:simpleType>
	<xsd:simpleType name="EncodingType">
		<xsd:annotation>
			<xsd:documentation>A list of allowed encodings used in a lot file</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="UTF8"/>
			<xsd:enumeration value="ISO8859-1"/>
			<xsd:enumeration value="EBCDIC"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="IntegrityMethodType">
		<xsd:annotation>
			<xsd:documentation>A list of allowed methods to check the integrity of a lot file</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="fileSize"/>
			<xsd:enumeration value="records"/>
			<xsd:enumeration value="MD5"/>
			<xsd:enumeration value="CRC16"/>
			<xsd:enumeration value="CRC32"/>
			<xsd:enumeration value="DSIG"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="SyntaxType">
		<xsd:annotation>
			<xsd:documentation>A list of allowed syntaxes to compose the messages in a lot file</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="XML"/>
			<xsd:enumeration value="Inhouse"/>
			<xsd:enumeration value="flat"/>
			<xsd:enumeration value="A1"/>
			<xsd:enumeration value="CSV"/>
			<xsd:enumeration value="Unknown"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="PatternLengthType">
		<xsd:annotation>
			<xsd:documentation>A list of allowed pattern lengths to compose the messages in a lot file</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="fixed"/>
			<xsd:enumeration value="fixedBlock"/>
			<xsd:enumeration value="variable"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="CBENumberType">
		<xsd:restriction base="xsd:integer">
			<xsd:minInclusive value="0"/>
			<xsd:maxInclusive value="1999999999"/>
			<xsd:whiteSpace value="collapse"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="SectorCodeType">
		<xsd:restriction base="xsd:integer">
			<xsd:minInclusive value="0"/>
			<xsd:maxInclusive value="999"/>
			<xsd:whiteSpace value="collapse"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="InstitutionTypeType">
		<xsd:restriction base="xsd:integer">
			<xsd:whiteSpace value="collapse"/>
			<xsd:minInclusive value="0"/>
			<xsd:maxInclusive value="999"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- End definition of the simple types -->
	<!-- Start definition of the complex types -->
	<xsd:complexType name="NotificationType">
		<xsd:sequence>
			<xsd:element name="emailAddress" type="xsd:string"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="SocialSecurityOrganizationType">
		<xsd:sequence>
			<xsd:element name="sectorCode" type="tns:SectorCodeType"/>
			<xsd:element name="institutionType" type="tns:InstitutionTypeType"/>
			<xsd:element name="CBENumber" type="tns:CBENumberType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>Crosssroads Bank for Enterprises code</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="OrganizationType">
		<xsd:choice>
			<xsd:element name="socialSecurityOrganization" type="tns:SocialSecurityOrganizationType"/>
			<xsd:element name="CBENumber" type="tns:CBENumberType">
				<xsd:annotation>
					<xsd:documentation>Crossroads Bank for Enterprises number</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:choice>
	</xsd:complexType>
	<xsd:complexType name="LotPackageVoucherType">
		<xsd:annotation>
			<xsd:documentation>Type to create a descriptive voucher for the exchange of lot message files</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="metaData" type="tns:VoucherMetaDataType">
				<xsd:annotation>
					<xsd:documentation>Global voucher information</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="packagedLotFiles" type="tns:PackagedLotFilesType">
				<xsd:annotation>
					<xsd:documentation>The collection of bundled files in regards with the application specified in the metadata</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="VoucherMetaDataType">
		<xsd:annotation>
			<xsd:documentation>Type to put descriptive metadata of the voucher file</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="voucherName">
				<xsd:annotation>
					<xsd:documentation>The filename of the lot package voucher file
					
Naming convention :
•	Target environment
-	p for production
-	a for acceptance
-	t for test
•	Direction
-	f from partner to CBSS
-	t from CBSS to partner
•	Author organization
-	's' + 6 digits = Sector code + Institution type 
-	'e' + CBE number value
•	Application file content structure
-	'-' + A1 || BatchSOAP || xml + '-' 
•	'd' + Mile stone value
•	'u' + Unique voucher identifier number
•	Finalized with: voucher.xml
•	Sample: pts020000-xml-d20090723u912voucher.xml
</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="100"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="version" type="xsd:integer">
				<xsd:annotation>
					<xsd:documentation>An incremental version number of the voucher file. </xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="uniqueIdentifier">
				<xsd:annotation>
					<xsd:documentation>Unique identifier number assigned to the voucher file by the organization that composed the file.</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="65"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="mileStone">
				<xsd:annotation>
					<xsd:documentation>Represents the frequency of voucher delivery fot the type of application. Corresponds with the mile stone indicator used in the voucher name.
-	yyyyMMdd (e.g. daily or unpredictable frequency)
-	yyyyMM (e.g. monthly or quarterly)
-	yyyy (e.g. per year or multiple years)</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="8"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="timestamp" type="xsd:dateTime">
				<xsd:annotation>
					<xsd:documentation>Timestamp on creation of the voucher file </xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="author" type="tns:OrganizationType">
				<xsd:annotation>
					<xsd:documentation>Organization that created the lot mesage files and voucher to be transferred</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="addressee" type="tns:OrganizationType">
				<xsd:annotation>
					<xsd:documentation>Organization that must receive the lot mesage files and voucher</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="environment" type="tns:EnvironmentType">
				<xsd:annotation>
					<xsd:documentation>Environment for which the voucher and lot mesage files are intended to. Corresponds to the first character in the voucher name.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="applicationCode">
				<xsd:annotation>
					<xsd:documentation>Indicates the application for which the messages in the lot file are intended to</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="tns:ApplicationCodeType">
						<xsd:maxLength value="50"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="operationCode" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>The operation of the application that was executed or is to be executed.</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="50"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="notification" type="tns:NotificationType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>If provided, the author wants to receive a notification and validity information via the specified email address.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="PackagedLotFilesType">
		<xsd:annotation>
			<xsd:documentation>All lot message files to be transferred</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element name="packagedLotFile" type="tns:PackagedLotFileType"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="PackagedLotFileType">
		<xsd:annotation>
			<xsd:documentation>Type to put descriptive metadata of a lot message file</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="lotFileName" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>The filename of the uncompressed lot message file
The extension must correspond with the type of file.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<!-- JVG :  Add of optional FileSequence number  -->
			<xsd:element name="fileSequenceNumber" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>Optional field.  This field gives the sequence number of the file.  This sequence is increased for each file within a voucher.  Used when the order of files is important.</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:integer">
						<xsd:minInclusive value="1"/>
						<xsd:maxInclusive value="999999999999999"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="compressedFileName" type="xsd:string" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>The filename of the compressed file that contains the lot file.
The extension must correspond with the used compression method. Supported compressions are gz, zip, zlib and bzip.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="timestamp" type="xsd:dateTime">
				<xsd:annotation>
					<xsd:documentation>Timestamp on creation of the lot message file </xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="encoding" type="tns:EncodingType">
				<xsd:annotation>
					<xsd:documentation>The encoding in which the file is created</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="messageStructure" type="tns:MessageStructureType"/>
			<xsd:element name="integrity" type="tns:IntegrityType" minOccurs="0"/>
			<xsd:element name="fileContentInformation" type="tns:FileContentInformationType" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="IntegrityType">
		<xsd:annotation>
			<xsd:documentation>Collection of all integrity checks to perform on a file</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element name="integrityCheck" type="tns:IntegrityCheckType"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="IntegrityCheckType">
		<xsd:annotation>
			<xsd:documentation>Type to identify a method to check the integrity of a file</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="integrityMethod" type="tns:IntegrityMethodType">
				<xsd:annotation>
					<xsd:documentation>Indicates the method to use to perform an integrity check</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:choice>
				<xsd:element name="value" type="xsd:string">
					<xsd:annotation>
						<xsd:documentation>The value to use to perform the integrity check</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="referenceFileName" type="xsd:string">
					<xsd:annotation>
						<xsd:documentation>A reference to a file that contains the information to perform the integrity check
The value of the lotFileName element is used to look up the corresponding information in the reference file</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="MessageStructureType">
		<xsd:annotation>
			<xsd:documentation>Type to specify the message structure in of a file</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="patternLength" type="tns:PatternLengthType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>Specifies if the length is bound to a certain pattern</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="minLength" type="xsd:integer" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>The minimum length of a record</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="maxLength" type="xsd:integer" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>The maximum length of a record</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="syntax" type="tns:SyntaxType">
				<xsd:annotation>
					<xsd:documentation>Indicates the syntax used to express the message</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="FileContentInformationType">
		<xsd:annotation>
			<xsd:documentation>Contains information regarding the content of a file</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element name="contentInformation" type="tns:ContentInformationType"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="ContentInformationType">
		<xsd:annotation>
			<xsd:documentation>Contains information of a certain type that can be found in a file</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="class" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>Specifies the type of content information</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="code" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>Specifies the item in the set of items corresponding with the specified content information class</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="total" type="xsd:integer">
				<xsd:annotation>
					<xsd:documentation>Specifies the total number of elements found of a certain class with the specified code</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<!-- End definition of the complex types -->
</xsd:schema>
