<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
		targetNamespace="http://schemas.fi.se/TRS/InClient"
		xmlns="http://schemas.fi.se/TRS/InClient"
		elementFormDefault="unqualified">
	<xs:annotation>
		<xs:appinfo>TRS - customerclient format</xs:appinfo>
		<xs:documentation>
			<Status>
				<Status>Production</Status>
				<Description>Production</Description>
				<Version>1.0</Version>
				<Revisions>
					<Revision date="2007-06-08">Schema name convension changed and Fixed Version attibute added at root element</Revision>
					<Revision date="2008-05-29">Added patter to exclude the character ¤</Revision>
				</Revisions>
			</Status>
			<Subject>
				<Project>TRS</Project>
				<Category>Customer Client</Category>
			</Subject>
			<Title>TRS - customerclient format</Title>
			<Type>Architectural</Type>
			<Description>Customer client report requested by the SE authority</Description>
			<Language>English</Language>
		</xs:documentation>
	</xs:annotation>

	<!--  BIC code type   -->
	<xs:simpleType name="BICCodeType">
		<xs:annotation>
			<xs:documentation>ISO 9362 - SWIFT/Bank Identifier Code (BIC) - Format: 11(x)</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:length value="11" />
			<xs:pattern id="upperCaseLetters11" value="[A-Z|0-9]{0,11}" />
		</xs:restriction>
	</xs:simpleType>

	<!--  String with a max length of 11   -->
	<xs:simpleType name="StringType11">
		<xs:annotation>
			<xs:documentation>Format: max 11(x)</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:minLength value="0" />
			<xs:maxLength value="11" />
			<xs:pattern value="[^¤]*" />
		</xs:restriction>
	</xs:simpleType>

	<!--  String with a max length of 20   -->
	<xs:simpleType name="StringType20">
		<xs:annotation>
			<xs:documentation>Format: max 20(x)</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:minLength value="0" />
			<xs:maxLength value="20" />
			<xs:pattern value="[^¤]*" />
		</xs:restriction>
	</xs:simpleType>

	<!--  String with a max length of 40   -->
	<xs:simpleType name="StringType40">
		<xs:annotation>
			<xs:documentation>Format: max 40(x)</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:minLength value="1" />
			<xs:maxLength value="40" />
			<xs:pattern value="[^¤]*" />
		</xs:restriction>
	</xs:simpleType>

	<!--  String with a max length of 70   -->
	<xs:simpleType name="StringType70">
		<xs:annotation>
			<xs:documentation>Format: max 70(x)</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:minLength value="0" />
			<xs:maxLength value="70" />
			<xs:pattern value="[^¤]*" />
		</xs:restriction>
	</xs:simpleType>

	<!--  Client code: -->
	<xs:simpleType name="ClientCodeType">
		<xs:annotation>
			<xs:documentation>B = BIC or I = Internal</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="B|I" />
		</xs:restriction>
	</xs:simpleType>

	<!--  CustomerClient definition   -->
	<xs:complexType name="CustomerClientRecordInfoCompleteDescriptionType">
		<xs:sequence>
			<xs:element name="Client">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="StringType40">
							<xs:attribute name="CodeType" type="ClientCodeType" use="required" />
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="ClientName" type="StringType70" />
			<xs:element name="ClientIdentificationLocal" type="StringType20" />
			<xs:element name="ClientStreet" type="StringType70" />
			<xs:element name="ClientZipCode" type="StringType70" />
			<xs:element name="ClientCity" type="StringType70" />
			<xs:element name="ClientCountry" type="StringType70" />
			<xs:element name="ProxyHolder" type="StringType11" minOccurs="0" maxOccurs="1" />
		</xs:sequence>
	</xs:complexType>

	<!-- CustomerClient schema  -->
	<xs:element name="report">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="TechnicalReportingFirm">
					<xs:complexType>
						<xs:attribute name="Identification" type="BICCodeType" use="required" />
					</xs:complexType>
				</xs:element>
				<xs:element name="ReportingFirm" minOccurs="1" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="CustomerClient" type="CustomerClientRecordInfoCompleteDescriptionType" minOccurs="1" maxOccurs="unbounded" />
						</xs:sequence>
						<xs:attribute name="Identification" type="BICCodeType" use="required" />
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="Version" type="xs:decimal" use="required" fixed="1.00"/>
		</xs:complexType>
	</xs:element>
</xs:schema>
