<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <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="30"/>
      <xs:pattern value="[A-Z,0-9,_,//,А-Я]{1,25}"/>
    </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="30"/>
      <xs:pattern value="[A-Z,0-9,//]{1,30}"/>
    </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="0"/>
      <xs:maxLength value="200"/>
    </xs:restriction>
  </xs:simpleType>
   <xs:simpleType name="TAXRATE_Type">
    <xs:annotation>
      <xs:documentation>Допустимые налоговые ставки (в процентах)</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:maxLength value="5"/>
      <xs:enumeration value="10"/>
      <xs:enumeration value="15"/>
      <xs:enumeration value="20"/>
      <xs:enumeration value="25"/>
      <xs:enumeration value="30"/>
      <xs:enumeration value="30BAD"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="YES_NO_Type">
    <xs:annotation>
      <xs:documentation>Тип: " "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="ISIN_Type">
    <xs:annotation>
      <xs:documentation>Тип: "Код ISIN"</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:maxLength value="12"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="DepoAccount_Type">
    <xs:annotation>
      <xs:documentation>Тип: "Номер субсчета в Расчетном депозитарии"</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:minLength value="10"/>
      <xs:maxLength value="12"/>
      <xs:pattern value="[A-Z,0-9,//]{1,12}"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="QUANTITY_Type">
    <xs:annotation>
      <xs:documentation>Тип: "Количество"</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.8_Type">
    <xs:annotation>
      <xs:documentation>Тип: "Вещественное число с длиной дробной части = 6"</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:decimal">
      <xs:totalDigits value="20"/>
      <xs:fractionDigits value="8"/>
    </xs:restriction>
  </xs:simpleType>	  
  <xs:element name="RTS_DOC">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="DOC_REQUISITES"/>
        <xs:element ref="TAX_REPORT"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="DOC_REQUISITES">
    <xs:complexType>
      <xs:attribute name="DOC_DATE" use="required" type="xs:date"/>
      <!--Дата формирования документа-->
      <xs:attribute name="DOC_TIME" use="required" type="xs:time"/>
      <!--Время формирования документа-->
      <xs:attribute name="DOC_NO" use="required" type="DOCNO_Type"/>
      <!--Уникальный учетный номер документа-->
      <xs:attribute name="DOC_TYPE_ID" use="required" type="xs:NCName"/>
      <!--Идентификатор типа документа-->
      <xs:attribute name="RECEIVER_ID" use="required" type="SENDERID_Type"/>
      <!--Код ЭДО РТС получателя -->
      <xs:attribute name="SENDER_ID" use="required" type="SENDERID_Type"/>
      <!--Краткое наименование отправителя-->
      <xs:attribute name="SENDER_NAME" use="optional" type="SENDERNAME_Type"/>
      <!--Краткое наименование отправителя-->
      <xs:attribute name="REMARKS" use="required" type="REMARKS_Type"/>
      <!--Текст примечания к документу-->
    </xs:complexType>
  </xs:element>
  <xs:element name="TAX_REPORT">
    <xs:complexType>
      <xs:sequence>
        <!-- Данные корпсобытия-->
        <xs:element ref="CORP_EVENT"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="CORP_EVENT">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="unbounded" ref="DEPO_ACCOUNT"/>
        <!-- Налоговое раскрытие по депозитарному счету по данной ценной бумаге -->        
      </xs:sequence>
      <xs:attribute name="IssueISIN" use="required" type="ISIN_Type"/>
      <!-- Идентификатор ЦБ, по которой ожидается выплата дивидендов -->            
      <xs:attribute name="RecordDate" use="required" type="xs:date"/>
      <!--Дата сбора реестра по данному корпсобытию-->      
    </xs:complexType>
  </xs:element>
  
  <xs:element name="DEPO_ACCOUNT">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="unbounded" ref="TAX_RECORD"/>
        <!-- Количество ЦБ на счете с указанной налоговой ставкой -->        
        <xs:element minOccurs="1" maxOccurs="1" ref="TOTAL"/>
        <!-- Общее количество ЦБ на счете, контрольная сумма -->        
      </xs:sequence>
      <xs:attribute name="AccountNumber" use="required" type="DepoAccount_Type"/>
      <!-- Номер депозитарного субсчета -->
    </xs:complexType>
  </xs:element>
  
  <xs:element name="TAX_RECORD">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="FLOAT_20.8_Type">
          <xs:attribute name="TaxRate" use="required"/>
          <!-- Налоговая ставка -->
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="TOTAL" type="FLOAT_20.8_Type"/>
</xs:schema>
