<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:simpleType name="DOCTYPEID_Type">
		<xs:annotation>
			<xs:documentation>Type: "Unique document type in the Electronic Document Management System"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="0"/>
			<xs:maxLength value="20"/>
			<xs:pattern value="[A-Z,0-9,_,//,А-Я]{1,20}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="DOCNO_Type">
		<xs:annotation>
			<xs:documentation>Type: "Unique document tracking number in the Electronic Document Management System"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="0"/>
			<xs:maxLength value="20"/>
			<xs:pattern value="[A-Z,0-9,//]{1,20}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="SENDERID_Type">
		<xs:annotation>
			<xs:documentation> Type: "Sender Identifier"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="7"/>
			<xs:minLength value="3"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="SENDERNAME_Type">
		<xs:annotation>
			<xs:documentation>Short name of the sender</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="0"/>
			<xs:maxLength value="120"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="REMARKS_Type">
		<xs:annotation>
			<xs:documentation>Type: "Notes to the document"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="0"/>
			<xs:maxLength value="120"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="RECNO_Type">
		<xs:annotation>
			<xs:documentation>Type "Record number"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:integer">
			<xs:totalDigits value="11"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="FIRMID_Type">
		<xs:annotation>
			<xs:documentation>Type: "Clearing Member Identifier"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="0"/>
			<xs:maxLength value="12"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="FIRMNAME_Type">
		<xs:annotation>
			<xs:documentation>Type: "Short name of member"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="0"/>
			<xs:maxLength value="120"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="STRING12_Type">
		<xs:annotation>
			<xs:documentation>Type: "12 characters"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="0"/>
			<xs:maxLength value="12"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="COUNTRY_Type">
		<xs:annotation>
			<xs:documentation>3 characters country code</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="0"/>
			<xs:maxLength value="3"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="FIRM_DETAILS_Type">
		<xs:annotation>
			<xs:documentation>Type : "Requisites Clearing Member"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="32"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="QUANTITY_Type">
		<xs:annotation>
			<xs:documentation>Type: "Quantity"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:decimal">
			<xs:totalDigits value="20"/>
			<xs:fractionDigits value="0"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="FLOAT_20.2_Type">
		<xs:annotation>
			<xs:documentation>Type: "Real number with fractional length = 2"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:decimal">
			<xs:totalDigits value="20"/>
			<xs:fractionDigits value="2"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="WEEKDAY_Type">
		<xs:annotation>
			<xs:documentation>Type: "Weekday"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="20"/>
			<xs:enumeration value="Monday"/>
			<xs:enumeration value="Tuesday"/>
			<xs:enumeration value="Wednesday"/>
			<xs:enumeration value="Thursday"/>
			<xs:enumeration value="Friday"/>
			<xs:enumeration value="Saturday"/>
			<xs:enumeration value="Sunday"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="YES_NO_Type">
		<xs:annotation>
			<xs:documentation>Type: " "Y"-YES, "N"-NO"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="1"/>
			<xs:enumeration value="Y"/>
			<xs:enumeration value="N"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="ACCESS_STATUS_Type">
		<xs:annotation>
			<xs:documentation>
				Trading Member status
				A – admitted or renewed
				N – admission suspended
				D – admission terminated
				
				Trading Member client status
				А – registered (admitted) or renewed
				N – registration suspended (suspended)
				D – registration terminated (admission terminated)
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="1"/>
			<xs:enumeration value="A"/>
			<xs:enumeration value="N"/>
			<xs:enumeration value="D"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="STATUS_Type">
		<xs:annotation>
			<xs:documentation>
				Operation type:     	
				A – add
				U – update
				D – delete      	
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="1"/>
			<xs:enumeration value="A"/>
			<xs:enumeration value="U"/>
			<xs:enumeration value="D"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="STRING32_Type">
		<xs:annotation>
			<xs:documentation>Type "32 characters"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="32"/>
		</xs:restriction>
	</xs:simpleType>


	<xs:simpleType name="TYPE_Type">
		<xs:annotation>
			<xs:documentation>Type "Type of Trading Member client (the second level client)"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="3"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="DETAILS_Type">
		<xs:annotation>
			<xs:documentation>Type "Requisites of Trading Member client (the second level client)"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="64"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="REGULATOR_Type">
		<xs:annotation>
			<xs:documentation>Type "Client code in accordance with Regulation No. 437-P"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="128"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="DOC_REQUISITES_Type">
		<xs:annotation>
			<xs:documentation>Details of the document in the electronic document management system</xs:documentation>
		</xs:annotation>
		<xs:attribute name="DOC_DATE" type="xs:date" use="required"> 

	<!--Дата формирования документа-->
	</xs:attribute>
	<xs:attribute name="DOC_TIME" type="xs:time" use="required">
		<!--Время формирования документа-->
	</xs:attribute>
	<xs:attribute name="DOC_NO" type="DOCNO_Type" use="required">
		<!--Уникальный учетный номер документа-->
	</xs:attribute>
	<xs:attribute name="DOC_TYPE_ID" type="DOCTYPEID_Type"  use="optional">
		<!--Идентификатор типа документа-->
	</xs:attribute>
	<xs:attribute name="SENDER_ID" type="SENDERID_Type" use="required">
		<!--Идентификатор фирмы-отправителя документа-->
	</xs:attribute>
	<xs:attribute name="SENDER_NAME" type="SENDERNAME_Type" default="OAO Sender" use="optional">
		<!--Краткое наименование отправителя-->
	</xs:attribute>
	<xs:attribute name="RECEIVER_ID" type="SENDERID_Type" use="required">
		<!--Код ЭДО РТС получателя -->
	</xs:attribute>
	<xs:attribute name="REMARKS" type="REMARKS_Type" use="optional">
		<!--Текст примечания к документу-->
	</xs:attribute>
	</xs:complexType>
	
	
	<xs:element name="RTS_DOC">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="DOC_REQUISITES"/>
				<xs:element ref="ITS82"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="DOC_REQUISITES" type="DOC_REQUISITES_Type"/>
	<xs:element name="ITS82">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="FIRM" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="ReportDate" type="xs:date" use="required"/>
			<xs:attribute name="ReportDesc" type="xs:string" use="required"/>
			<xs:attribute name="ReportVersion" type="xs:string" use="required"/>
			<xs:attribute name="Weekday" type="WEEKDAY_Type" use="required"/>
			<xs:attribute name="Volume" type="xs:positiveInteger" use="optional"/>
			<xs:attribute name="VolumeTotal" type="xs:positiveInteger" use="optional"/>
			<xs:attribute name="ReportNumber" type="xs:string" use="optional"/>	
			
		</xs:complexType>
	</xs:element>
	<xs:element name="FIRM">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="RECORDS" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="FirmID" type="FIRMID_Type" use="required"/>			
			<xs:attribute name="FirmName" type="FIRMNAME_Type" use="required"/>
			<xs:attribute name="FirmDetails" type="FIRM_DETAILS_Type" use="required"/>
		</xs:complexType>
	</xs:element>

	<xs:element name="RECORDS">
		<xs:complexType>
			<xs:attribute name="ClientCode" type="STRING12_Type" use="required"/>
			<xs:attribute name="Principal" type="YES_NO_Type" use="optional"/>
			<xs:attribute name="Type" type="TYPE_Type" use="optional"/>
			<xs:attribute name="Details" type="DETAILS_Type" use="optional"/>
			<xs:attribute name="CountryCode" type="COUNTRY_Type" use="optional"/>
			<xs:attribute name="RegulatorCode" type="REGULATOR_Type" use="optional"/>
			<xs:attribute name="Q_Investor" type="YES_NO_Type" use="optional"/>
			<xs:attribute name="Status" type="STATUS_Type" use="required"/>
			<xs:attribute name="AccessStatus" type="ACCESS_STATUS_Type" use="required"/>
			<xs:attribute name="CheckCrossMarket" type="YES_NO_Type" use="optional"/>
			<xs:attribute name="IndividualInvestmentAccount" type="YES_NO_Type" use="optional"/>
			
			<xs:attribute name="ForeignSecurityClientProhibition" type ="YES_NO_Type" use="optional"/>      
			<xs:attribute name="ForeignETFClientProhibition" type ="YES_NO_Type" use="optional"/>      
			<xs:attribute name="UnquotRuSecurityClientProhibition" type ="YES_NO_Type" use="optional"/>      
			<xs:attribute name="DerivativesClientProhibition" type ="YES_NO_Type" use="optional"/>      
			<xs:attribute name="UnratedRuBondClientProhibition" type ="YES_NO_Type" use="optional"/>      
			<xs:attribute name="ForeignBondClientProhibition" type ="YES_NO_Type" use="optional"/>      
			<xs:attribute name="StructuredBondClientProhibition" type ="YES_NO_Type" use="optional"/>      
			<xs:attribute name="StructuredIncomeBondClientProhibition" type ="YES_NO_Type" use="optional"/>      
			<xs:attribute name="RepoClientProhibition" type ="YES_NO_Type" use="optional"/>  
			<xs:attribute name="ClosedFundClientProhibition" type ="YES_NO_Type" use="optional"/>  
			
		</xs:complexType>
	</xs:element>
</xs:schema>

