<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.reinf.esocial.gov.br/schemas/evtExclusao/v1_02_00" targetNamespace="http://www.reinf.esocial.gov.br/schemas/evtExclusao/v1_02_00" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="./xmldsig-core-schema.xsd"/>
  <xs:element name="Reinf">
    <xs:annotation>
      <xs:documentation>EFD-Reinf</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="evtExclusao" minOccurs="1" maxOccurs="1">
          <xs:annotation>
            <xs:documentation>Evento destinado a exclusão de eventos</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ideEvento" minOccurs="1" maxOccurs="1">
                <xs:annotation>
                  <xs:documentation>Informações de Identificação do Evento</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="tpAmb" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Identificação do ambiente:
                            1 - Produção;
                            2 - Produção restrita - dados reais;
                            3 - Produção restrita - dados fictícios.
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:unsignedByte">
                          <xs:pattern value="[1-3]{1}"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="procEmi" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Processo de emissão do evento:
                            1 - Aplicativo do contribuinte.
                            2 - Aplicativo governamental.
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:unsignedByte">
                          <xs:pattern value="1|2"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>                    
                    <xs:element name="verProc" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Versão do processo de emissão do evento.  Informar a versão do aplicativo emissor do evento</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:minLength value="1"/>
                          <xs:maxLength value="20"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="ideContri" minOccurs="1" maxOccurs="1">
                <xs:complexType>
                  <xs:annotation>
                    <xs:documentation>Informações de identificação do contribuinte</xs:documentation>
                  </xs:annotation>
                  <xs:sequence>
                    <xs:element name="tpInsc" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Preencher com o código correspondente ao tipo de inscrição. 1-CNPJ;2-CPF</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:unsignedByte">
                          <xs:pattern value="1|2"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="nrInsc" minOccurs="1" maxOccurs="1">
                      <xs:annotation>
                        <xs:documentation>Informar o número de inscrição do contribuinte de acordo com o tipo de inscrição indicado no campo {tpInsc}.Se for um CNPJ deve ser informada apenas a Raiz/Base de oito posições, exceto se natureza jurídica de administração pública direta federal ([101-5], [104-0], [107-4], [116-3], situação em que o campo deve ser preenchido com o CNPJ completo (14 posições).</xs:documentation>
                      </xs:annotation>
                      <xs:simpleType>
                        <xs:restriction base="xs:string">
                          <xs:minLength value="8"/>
                          <xs:maxLength value="14"/>
                          <xs:pattern value="\d{8}|\d{11}|\d{14}"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="infoExclusao" minOccurs="1" maxOccurs="1">
                <xs:complexType>
                  <xs:annotation>
                    <xs:documentation>Registro que identifica o evento objeto da exclusão</xs:documentation>
                  </xs:annotation>
                  <xs:sequence>
                    <xs:element name="tpEvento" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Preencher com o tipo de evento, conforme tabela 10</xs:documentation>
                        </xs:annotation>                        
                        <xs:restriction base="xs:string">
                          <xs:enumeration value="R-2010"/>
                          <xs:enumeration value="R-2020"/>
                          <xs:enumeration value="R-2030"/>
                          <xs:enumeration value="R-2040"/>
                          <xs:enumeration value="R-2050"/>
                          <xs:enumeration value="R-2060"/>
                          <xs:enumeration value="R-2070"/>
                          <xs:enumeration value="R-3010"/>
                          <xs:length value="6"/>
                        </xs:restriction>                      
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="nrRecEvt" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Preencher com o número do recibo do evento que será excluído.
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:minLength value="16"/>
                          <xs:maxLength value="52" />
                          <xs:pattern value="[0-9]{1,18}[-][0-9]{2}[-][0-9]{4}[-][0-9]{4,6}[-][0-9]{1,18}"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="perApur" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                        <xs:documentation>
                          Informar o período de referência das informações no formato AAAA-MM, exceto se {tpEvento} = [R-3010], situação em que deve ser informado no formato AAAA-MM-DD
                        </xs:documentation>
                        </xs:annotation>
                        <xs:union>
                          <xs:simpleType>
                          <xs:restriction base="xs:gYearMonth">
                            <xs:pattern value="2{1}[0-9]{3}-{1}[0-1]{1}[0-9]{1}"/>
                          </xs:restriction>
                          </xs:simpleType>
                          <xs:simpleType>
                          <xs:restriction base="xs:date">
                            <xs:pattern value="2{1}[0-9]{3}-{1}[0-1]{1}[0-9]{1}-{1}[0-3]{1}[0-9]{1}"/>
                          </xs:restriction>
                          </xs:simpleType>
                        </xs:union>
                      </xs:simpleType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>              
            </xs:sequence>
            <xs:attribute name="id" use="required" >
              <xs:annotation>
                <xs:documentation>Identificação única do evento.</xs:documentation>
              </xs:annotation>
              <xs:simpleType>
                <xs:restriction base="xs:ID">
                  <xs:length value="36" />
                  <xs:pattern value="I{1}D{1}[0-9]{34}" />
                </xs:restriction>
              </xs:simpleType>
            </xs:attribute>
          </xs:complexType>
        </xs:element>
        <xs:element ref="ds:Signature"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>