<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:simpleType name="FIRMID_Type">
		<xs:annotation>
			<xs:documentation>Тип: "Код поставляемой бумаги"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="12"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="FIRMNAME_Type">
		<xs:annotation>
			<xs:documentation>Тип: "Код поставляемой бумаги"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="512"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="STRING32_Type">
		<xs:annotation>
			<xs:documentation>Тип: "Код поставляемой бумаги"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="32"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="CURRENCYID_Type">
		<xs:annotation>
			<xs:documentation>Тип: "Идентификатор вылюты"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="4"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="CURRENCYNAME_Type">
		<xs:annotation>
			<xs:documentation>Тип: "Наименование вылюты"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="30"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="FLOAT20_2_Type">
		<xs:annotation>
			<xs:documentation>Тип: "Количество"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:decimal">
			<xs:totalDigits value="20"/>
			<xs:fractionDigits value="2"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="VOLUME_Type">
		<xs:annotation>
			<xs:documentation>Тип: "Вещественное число с длиной дробной части = 2"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:decimal">
			<xs:totalDigits value="26"/>
			<xs:fractionDigits value="2"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="WEEKDAY_Type">
		<xs:annotation>
			<xs:documentation>Тип: "Наименование дня недели"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="20"/>
			<xs:enumeration value="Понедельник"/>
			<xs:enumeration value="Вторник"/>
			<xs:enumeration value="Среда"/>
			<xs:enumeration value="Четверг"/>
			<xs:enumeration value="Пятница"/>
			<xs:enumeration value="Суббота"/>
			<xs:enumeration value="Воскресенье"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="DOCNO_Type">
		<xs:annotation>
			<xs:documentation>Тип: "Уникальный учетный номер документа в системе ЭДО"</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,12}"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="DOCTYPEID_Type">
		<xs:annotation>
			<xs:documentation>Тип: "Идентификатор типа документа в системе электронного документооборота"</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,12}"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="SENDERID_Type">
		<xs:annotation>
			<xs:documentation>Тип: "Идентификатор фирмы отправителя/получателя ЭДО"</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>Тип: "Краткое наименование отправителя"</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>Тип: "Примечание к документу"</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="120"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="DOC_REQUISITES_Type">
		<xs:annotation>
			<xs:documentation>Реквизиты документа в системе электронного документооборота</xs:documentation>
		</xs:annotation>
		<xs:attribute name="DOC_DATE" type="xs:date" use="required"/>	
		<xs:attribute name="DOC_TIME" type="xs:time" use="required"/>
		<xs:attribute name="DOC_NO" type="DOCNO_Type" use="required"/>			
		<xs:attribute name="DOC_TYPE_ID" type="DOCTYPEID_Type"  use="optional"/>			
		<xs:attribute name="SENDER_ID" type="SENDERID_Type" use="optional"/>
		<xs:attribute name="SENDER_NAME" type="SENDERNAME_Type" default="ОАО Отправитель" use="optional"/>
		<xs:attribute name="RECEIVER_ID" type="SENDERID_Type" use="optional"/>			
		<xs:attribute name="REMARKS" type="REMARKS_Type" use="optional"/>			
	</xs:complexType>
	
	<xs:element name="RTS_DOC">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="DOC_REQUISITES"/>
				<xs:element ref="CBR_COLLATERAL"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="DOC_REQUISITES" type="DOC_REQUISITES_Type"/>
	
	<xs:element name="CBR_COLLATERAL">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="FIRM" maxOccurs="unbounded"/>				
			</xs:sequence>
			<xs:attribute name="ReportDate" type="xs:date" use="optional"/>
			<xs:attribute name="ReportDesc" type="xs:string" use="required"/>
			<xs:attribute name="ReportVersion" type="xs:string" use="optional"/>			
			<xs:attribute name="Weekday" type="xs:integer" use="optional"/>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="FIRM">
		<xs:complexType>			
			<xs:sequence>
				<xs:element ref="COLLATERAL" maxOccurs="unbounded"/>
				<xs:element ref="OBLIGATION" 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="STRING32_Type" use="required"/>			
		</xs:complexType>
	</xs:element>
	
	
	<xs:element name="COLLATERAL">
		<xs:complexType>			
			<xs:attribute name="CollateralCurrencyId" type="CURRENCYID_Type" use="required"/>
			<xs:attribute name="CollateralCurrencyName" type="CURRENCYNAME_Type" use="optional"/>
			<xs:attribute name="CollateralSum" type="FLOAT20_2_Type" use="optional"/>
			<xs:attribute name="CollateralBlocked" type="FLOAT20_2_Type" use="optional"/>			
		</xs:complexType>
	</xs:element>	
	

	<xs:element name="OBLIGATION">
		<xs:complexType>
			<xs:attribute name="MarginCallSum" type="FLOAT20_2_Type" use="required"/>			
		</xs:complexType>
	</xs:element>

	
</xs:schema>
