<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.reinf.esocial.gov.br/schemas/envioLoteEventos/v1_01_01" targetNamespace="http://www.reinf.esocial.gov.br/schemas/envioLoteEventos/v1_01_01" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="Reinf">
    <xs:annotation>
      <xs:documentation>Elemento raiz do lote do Reinf.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="loteEventos">
          <xs:annotation>
            <xs:documentation>Contém a relação de eventos que compõe o lote.</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence minOccurs="1" maxOccurs="100">
              <xs:element name="evento" type="TArquivoeReinf"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
     </xs:complexType>
  </xs:element>
  <xs:complexType name="TArquivoeReinf">
    <xs:annotation>
      <xs:documentation>
        Define os dados de um arquivo da Reinf (evento).
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:any processContents="skip">
        <xs:annotation>
          <xs:documentation>
            Contém xml com o retorno do processamento do evento. (conforme Xsd retornoEvento)
          </xs:documentation>
        </xs:annotation>
      </xs:any>
    </xs:sequence>
    <xs:attribute name="id" use="required" type="xs:ID">
      <xs:annotation>
        <xs:documentation>
          Contém chave de acesso do evento.
          Esta informação é importante para que o próprio XSD consiga detectar se existe
          mais de um evento com mesmo ID no lote e, caso exista, negue sua recepção.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>

