<?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.esocial.gov.br/schema/evt/evtExclusao/v02_04_02" targetNamespace="http://www.esocial.gov.br/schema/evt/evtExclusao/v02_04_02" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
  <xs:element name="eSocial">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="evtExclusao">
          <xs:annotation>
            <xs:documentation>Evento de Exclusão</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ideEvento">
                <xs:annotation>
                  <xs:documentation>Informações de identificação do evento</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="tpAmb">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Tipo de ambiente</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:byte">
                          <xs:pattern value="\d"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="procEmi">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Processo de emissão do evento</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:byte">
                          <xs:pattern value="\d"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="verProc">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Versão do processo de emissão 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="ideEmpregador" type="TEmpregador">
                <xs:annotation>
                  <xs:documentation>Informações de identificação do empregador</xs:documentation>
                </xs:annotation>
              </xs:element>
              <xs:element name="infoExclusao">
                <xs:annotation>
                  <xs:documentation>Registro que identifica o evento objeto da exclusão.</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="tpEvento">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Tipo de Evento</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:minLength value="5"/>
                          <xs:maxLength value="6"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="nrRecEvt">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Número do recibo do evento</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:minLength value="1"/>
                          <xs:maxLength value="40"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="ideTrabalhador" minOccurs="0">
                      <xs:annotation>
                        <xs:documentation>Registro que identifica a qual trabalhador refere-se o evento a ser excluído.</xs:documentation>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="cpfTrab">
                            <xs:simpleType>
                              <xs:annotation>
                                <xs:documentation>CPF do trabalhador</xs:documentation>
                              </xs:annotation>
                              <xs:restriction base="xs:string">
                                <xs:length value="11"/>
                                <xs:pattern value="\d{11}"/>
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                          <xs:element name="nisTrab" minOccurs="0">
                            <xs:simpleType>
                              <xs:annotation>
                                <xs:documentation>NIS</xs:documentation>
                              </xs:annotation>
                              <xs:restriction base="xs:string">
                                <xs:maxLength value="11"/>
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="ideFolhaPagto" minOccurs="0">
                      <xs:annotation>
                        <xs:documentation>Registro que identifica a qual folha de pagamento pertence o evento que será excluído</xs:documentation>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="indApuracao">
                            <xs:simpleType>
                              <xs:annotation>
                                <xs:documentation>Indicativo de período de apuração:
                                1 - Mensal;
                                2 - Anual (13° salário).</xs:documentation>
                              </xs:annotation>
                              <xs:restriction base="xs:byte">
                                <xs:pattern value="\d"/>
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                          <xs:element name="perApur">
                            <xs:simpleType>
                              <xs:annotation>
                                <xs:documentation>Período ao qual se referem as informações.</xs:documentation>
                              </xs:annotation>
                              <xs:restriction base="xs:string">
                                <xs:minLength value="4"/>
                                <xs:maxLength value="7"/>
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="Id" type="xs:ID" use="required"/>
          </xs:complexType>
        </xs:element>
        <xs:element ref="ds:Signature"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="TEmpregador">
    <xs:sequence>
      <xs:element name="tpInsc">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Tipo de Inscrição, conforme tabela 5.</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:byte">
            <xs:pattern value="\d"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="nrInsc">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Número de Inscrição</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:string">
            <xs:pattern value="\d{8,15}"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:schema>
