<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://www.bankitalia.it/bolina/message" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:msg="http://www.bankitalia.it/bolina/message" xmlns:bdi="http://www.bankitalia.it/bolina/remark">
	<import namespace="http://www.bankitalia.it/bolina/remark" schemaLocation="remark.xsd"></import>

	<complexType name="outputMessage">
		<sequence>
			<element name="header" type="msg:messageHeader"
				minOccurs="1" maxOccurs="1">
			</element>
			<element name="content" type="msg:messageContent"
				minOccurs="1" maxOccurs="1">
			</element>
			<element name="footer" type="msg:messageFooter" minOccurs="1" maxOccurs="1"></element>
		</sequence>
	</complexType>

	<complexType name="messageHeader">
		<sequence>
			<element name="sender" type="msg:rows" minOccurs="1"
				maxOccurs="1">
			</element>
			<element name="receiver" type="msg:rows" minOccurs="1"
				maxOccurs="1">
			</element>
			<element name="object" type="msg:rows" minOccurs="1"
				maxOccurs="1">
			</element>
			<element name="reference" type="msg:rows" minOccurs="0"
				maxOccurs="1">
			</element>
			<element name="outReference" type="msg:rows" maxOccurs="1"
				minOccurs="0">
			</element>
			<element name="purpose" type="msg:rows" maxOccurs="1"
				minOccurs="0">
			</element>
		</sequence>
	</complexType>

	<complexType name="messageFooter">
		<sequence>
			<element name="footerText" type="msg:rows" minOccurs="1" maxOccurs="1"></element>
		</sequence>
	</complexType>

	<complexType name="messageContent">
		<sequence>
			<element name="contentHeader" type="msg:contentHeader" maxOccurs="1" minOccurs="0"></element>
			<element name="section" type="msg:messageSection"
				minOccurs="0" maxOccurs="unbounded">
			</element>
			<element name="contentFooter" type="msg:rows" maxOccurs="1" minOccurs="0"></element>
		</sequence>
	</complexType>
	
	 <complexType name="contentHeader">
    	<sequence>
    		<element name="summary" type="msg:rows" maxOccurs="1" minOccurs="0"></element>
			<element name="threshold" type="msg:rows" maxOccurs="1" minOccurs="0"></element>
			<element name="text" type="msg:rowText" maxOccurs="unbounded" minOccurs="0"></element>
    	</sequence>
    </complexType>

	<complexType name="messageSection">
		<sequence>
			<element name="header" type="msg:rows" minOccurs="1" maxOccurs="1"></element>
			<element name="remark" type="bdi:remark" minOccurs="1"
				maxOccurs="unbounded">
			</element>
			<element name="footer" type="msg:rows" minOccurs="0" maxOccurs="1"></element>
		</sequence>
		<attribute name="name" type="string"></attribute>
	</complexType>



    <element name="message" type="msg:outputMessage"></element>

    <complexType name="rowText">
    	<simpleContent>
    		<extension base="string">
    			<attribute name="row" type="string"></attribute>
    		</extension>
    	</simpleContent>
    </complexType>
    
    <complexType name="rows">
    	<sequence>
    		<element name="text" type="msg:rowText" maxOccurs="unbounded" minOccurs="0"></element>
    	</sequence>
    </complexType>



    <element name="messageHeader" type="msg:messageHeader"></element>

    <element name="messageContent" type="msg:messageContent"></element>

    <element name="messageFooter" type="msg:messageFooter"></element>
</schema>