<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!--	
************************************************************************************
COMPLEX TYPES 

FileErrorsCompleteDescriptionType: a min of 1 record with 
	no limit in the maximum of file error records that can be detailed.

FileErrorType: a sequence of two elements related to the file error: the 
	error reference number and the message

TransactionErrorsCompleteDescriptionType: a min of 1 record with 
	no limit in the maximum of transaction records that can be detailed.

TransactionErrorType: a sequence of four elements related to 
	the error: the id that identifies the transaction univocally, the error 
	reference number and the message. 

**************************************************************************************
-->
	<xs:complexType name="FileErrorsCompleteDescriptionType">
		<xs:sequence>
			<xs:element name="FileError" type="FileErrorType" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="FileErrorType">
		<xs:sequence>
			<xs:element name="FileErrorReference" type="FileErrorReferenceType" />
			<xs:element name="FileErrorMessage" type="ErrorMessageType" />
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="TransactionErrorsCompleteDescriptionType">
		<xs:sequence>
			<xs:element name="TransactionError" type="TransactionErrorType" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="TransactionErrorType">
		<xs:sequence>
			<xs:element name="TransactionRecordType" type="RecordType" />
			<xs:element name="TransactionCAUniqueId" type="CAUniqueIdType" />
			<xs:element name="TransactionErrorReference" type="TransactionErrorReferenceType" />
			<xs:element name="TransactionErrorMessage" type="ErrorMessageType" />
		</xs:sequence>
	</xs:complexType>
	<!--	
************************************************************************
SIMPLE TYPES 

FileErrorReferenceType: reference to the error corresponding
	to chapter 9.3 File Errors in the Functional Specification Doc.
	Format: FIL-nnn

TransactionErrorReferenceType: reference to the error corresponding
	to chapter 9.4 Content Errors in the Functional Specification Doc.
	Format: CON-nnn

ErrorMessageType: Message corresponding to the error reference.
	Format: a maximum of 90 characters.

RecordType: type of record in which the errors occurs.
	Format: T (Transaction) or C (Cancellation)

CAUniqueIdType:unique identifier of the original record which
	has errors required. Format: a minimum of 1 and a maximum of 
	40 characters.

************************************************************************
-->
	<xs:simpleType name="FileErrorReferenceType">
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="collapse" />
			<xs:pattern value="FIL-0[0-9][0-9]" />
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="TransactionErrorReferenceType">
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="collapse" />
			<xs:pattern value="CON-0[0-9][0-9]" />
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ErrorMessageType">
		<xs:restriction base="xs:string">
			<xs:minLength value="1" />
			<xs:maxLength value="999" />
			<xs:whiteSpace value="collapse" />
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="RecordType">
		<xs:restriction base="xs:string">
			<xs:pattern value="T|C" />
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="CAUniqueIdType">
		<xs:restriction base="xs:string">
			<xs:minLength value="1" />
			<xs:maxLength value="40" />
			<xs:whiteSpace value="collapse" />
		</xs:restriction>
	</xs:simpleType>
</xs:schema>

