<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://www.sped.fazenda.gov.br/nfse"
           xmlns:nfse="http://www.sped.fazenda.gov.br/nfse"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified">






    <xs:simpleType name="TSCNAONIF">
        <xs:annotation>
            <xs:documentation>Motivo para não informação do NIF (0, 1, 2).</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string"><xs:length value="1"/><xs:pattern value="[0-2]"/></xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSXNome">
        <xs:annotation>
            <xs:documentation>Nome / Razão Social do fornecedor (1-150).</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string"><xs:maxLength value="150"/></xs:restriction>
    </xs:simpleType>
    
    <xs:complexType name="TCFornec">
        <xs:annotation>
            <xs:documentation>Grupo de informações do fornecedor do documento referenciado.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:choice>
                <xs:element name="CNPJ" type="nfse:TSCNPJ"/>
                <xs:element name="CPF" type="nfse:TSCPF"/>
                <xs:element name="NIF" type="nfse:TSNIF"/>
            </xs:choice>
            <xs:element name="cNAONIF" type="nfse:TSCNAONIF"/>
            <xs:element name="xNome" type="nfse:TSXNome"/>
        </xs:sequence>
    </xs:complexType>





    <xs:simpleType name="TSChaveDFe">
        <xs:annotation>
            <xs:documentation>Chave do documento fiscal eletrônico do repositório nacional.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:length value="50"/>
            <xs:pattern value="[0-9]{50}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSTipoChaveDFe">
        <xs:annotation>
            <xs:documentation>Tipo do documento fiscal eletrônico: 1=NFS-e, 2=NF-e, 3=CT-e, 9=Outro.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:length value="1"/>
            <xs:pattern value="[1-3,9]"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSDesc255">
        <xs:annotation>
            <xs:documentation>Descrição de documentos e outras informações.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:minLength value="1"/>
            <xs:maxLength value="255"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSNumeroDocFiscal">
        <xs:annotation>
            <xs:documentation>Número do documento fiscal.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:minLength value="1"/>
            <xs:maxLength value="255"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSTpReeRepRes">
        <xs:annotation>
            <xs:documentation>Tipo de valor incluído neste documento, recebido por motivo de estarem relacionadas a operações de terceiros.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:maxLength value="2"/>
            <xs:pattern value="[0-9]{2}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSDescReeRepRes">
        <xs:annotation>
            <xs:documentation>Descrição do reembolso ou ressarcimento quando a opção é "99 - Outros reembolsos".</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:minLength value="1"/>
            <xs:maxLength value="150"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSValorReeRepRes">
        <xs:annotation>
            <xs:documentation>Valor monetário (total ou parcial) do reembolso/ressarcimento.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:maxLength value="15"/>
            <xs:pattern value="[0-9]{1,15}(\.[0-9]{2})?"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSCST">
        <xs:annotation>
            <xs:documentation>Código de Situação Tributária do IBS e da CBS.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:length value="3"/>
            <xs:pattern value="[0-9]{3}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSClassTrib">
        <xs:annotation>
            <xs:documentation>Código da Classificação Tributária do IBS e da CBS.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:length value="6"/>
            <xs:pattern value="[0-9]{6}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSCodCredPres">
        <xs:annotation>
            <xs:documentation>Código e classificação do crédito presumido: IBS e CBS.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:length value="2"/>
            <xs:pattern value="[0-9]{2}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="TCDocDFeNacional">
        <xs:annotation>
            <xs:documentation>Grupo de informações de documentos fiscais eletrônicos que se encontram no repositório nacional.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="tipoChaveDFe" type="nfse:TSTipoChaveDFe"/>
            <xs:element name="xTipoChaveDFe" type="nfse:TSDesc255" minOccurs="0"/>
            <xs:element name="chaveDFe" type="nfse:TSChaveDFe"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="TCDocFiscalOutro">
        <xs:annotation>
            <xs:documentation>Grupo de informações de documentos fiscais eletrônicos que não se encontram no repositório nacional.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="cMunDocFiscal" type="nfse:TSCodMunIBGE"/>
            <xs:element name="nDocFiscal" type="nfse:TSNumeroDocFiscal"/>
            <xs:element name="xDocFiscal" type="nfse:TSDesc255"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="TCDocOutro">
        <xs:annotation>
            <xs:documentation>Grupo de informações de documento não fiscal.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="nDoc" type="nfse:TSNumeroDocFiscal"/>
            <xs:element name="xDoc" type="nfse:TSDesc255"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="TCDocumentos">
        <xs:annotation>
            <xs:documentation>Grupo de documentos de reembolso/repasse/ressarcimento.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="tpReeRepRes" type="nfse:TSTpReeRepRes"/>
            <xs:choice>
                <xs:element name="dFeNacional" type="nfse:TCDocDFeNacional"/>
                <xs:element name="docFiscalOutro" type="nfse:TCDocFiscalOutro"/>
                <xs:element name="docOutro" type="nfse:TCDocOutro"/>
            </xs:choice>
            <xs:element name="fornec" type="nfse:TCFornec" minOccurs="0"/>

            <xs:element name="xTpReeRepRes" type="nfse:TSDescReeRepRes" minOccurs="0"/>
            <xs:element name="vlrReeRepRes" type="nfse:TSValorReeRepRes"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="TCGReeRepRes">
        <xs:annotation>
            <xs:documentation>Grupo relativo aos documentos referenciados nos casos de reembolso, repasse e ressarcimento.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="documentos" type="nfse:TCDocumentos" maxOccurs="1000"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="TCGTribRegular">
        <xs:annotation>
            <xs:documentation>Grupo de informações da Tributação Regular.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="CSTReg" type="nfse:TSCST"/>
            <xs:element name="cClassTribReg" type="nfse:TSClassTrib"/>
            <xs:element name="cCredPres" type="nfse:TSCodCredPres" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="TCGDif">
        <xs:annotation>
            <xs:documentation>Grupo de informações relacionadas ao diferimento para IBS e CBS.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="pDifUF" type="nfse:TSDec3V2"/>
            <xs:element name="pDifMun" type="nfse:TSDec3V2"/>
            <xs:element name="pDifCBS" type="nfse:TSDec3V2"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="TCGIBSCBS">
        <xs:annotation>
            <xs:documentation>Grupo de informações relacionadas ao IBS e à CBS.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="CST" type="nfse:TSCST"/>
            <xs:element name="cClassTrib" type="nfse:TSClassTrib"/>
            <xs:element name="cCredPres" type="nfse:TSCodCredPres" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="TCTrib">
        <xs:sequence>
            <xs:element name="gIBSCBS" type="nfse:TCGIBSCBS" minOccurs="0"/>
            <xs:choice>
                <xs:element name="gTribRegular" type="nfse:TCGTribRegular" minOccurs="0"/>
                <xs:element name="gDif" type="nfse:TCGDif" minOccurs="0"/>
            </xs:choice>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="TCIBSCBS">
        <xs:annotation>
            <xs:documentation>Grupo de informações declaradas pelo emitente referentes ao IBS e à CBS.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="valores" type="nfse:TCInfoValoresIBSCBS"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="TCInfoValoresIBSCBS">
        <xs:sequence>
            <xs:element name="gReeRepRes" type="nfse:TCGReeRepRes" minOccurs="0"/>
            <xs:element name="trib" type="nfse:TCTrib"/>
        </xs:sequence>
    </xs:complexType>









    <xs:simpleType name="TSInscImobFisc">
        <xs:annotation>
            <xs:documentation>Inscrição imobiliária fiscal (código fornecido pela prefeitura para a identificação da obra ou para fins de recolhimento do IPTU).</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:minLength value="1"/>
            <xs:maxLength value="30"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="TSCCIB">
        <xs:annotation>
            <xs:documentation>Código do Cadastro Imobiliário Brasileiro - CTB.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:length value="8"/>
            <xs:pattern value="[0-9]{8}"/>
        </xs:restriction>
    </xs:simpleType>
    
    <xs:complexType name="TCImovel">
        <xs:annotation>
            <xs:documentation>Grupo de informações de operações relacionadas a bens imóveis, exceto obras.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="inscImobFisc" type="nNFSE:TSInscImobFisc" minOccurs="0"/>
            <xs:element name="cCIB" type="nNFSE:TSCCIB" minOccurs="0"/>
            <xs:element name="end" type="nNFSE:TCEnderecoImovel"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="TCEnderecoImovel">
        <xs:annotation>
            <xs:documentation>Grupo de informações do endereço do imóvel.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="xLgr" type="nNFSE:TSLogradouro"/>
            <xs:element name="nro" type="nfse:TSNumeroEndereco"/>
            <xs:element name="xCpl" type="nNFSE:TSComplementoEndereco" minOccurs="0"/>
            <xs:element name="xBairro" type="nNFSE:TSBairro"/>
            <xs:choice>
                <xs:element name="CEP" type="nNFSE:TSCEP"/>
                <xs:element name="endExt" type="nNFSE:TCEnderExtImovel"/>
            </xs:choice>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="TCEnderExtImovel">
        <xs:annotation>
            <xs:documentation>Grupo de informações descritivas do endereço do imóvel no exterior.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="cEndPost" type="nNFSE:TSCodigoEndPostal"/>
            <xs:element name="xCidade" type="nNFSE:TSCidadeExterior"/>
            <xs:element name="xEstProvReg" type="nNFSE:TSEstadoProvRegExterior"/>
        </xs:sequence>
    </xs:complexType>














    <xs:simpleType name="TSCEP">
        <xs:annotation><xs:documentation>Código numérico do Endereçamento Postal nacional (CEP).</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:length value="8"/>
            <xs:pattern value="[0-9]{8}"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSCPF">
        <xs:annotation><xs:documentation>Número de inscrição no Cadastro Nacional de Pessoa Física (CPF).</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:length value="11"/>
            <xs:pattern value="[0-9]{11}"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSCNPJ">
        <xs:annotation><xs:documentation>Número de inscrição no Cadastro Nacional de Pessoa Jurídica (CNPJ).</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:length value="14"/>
            <xs:pattern value="[0-9]{14}"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSNIF">
        <xs:annotation><xs:documentation>Número de identificação fiscal fornecido por órgão de administração tributária no exterior.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="40"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSCodNaoNIF">
        <xs:annotation><xs:documentation>Motivo para não informação do NIF.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:pattern value="[0-9]"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSNomeEmpresarial">
        <xs:annotation><xs:documentation>Nome / Nome Empresarial do destinatário.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="150"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSLogradouro">
        <xs:annotation><xs:documentation>Tipo e nome do logradouro do endereço do destinatário.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="255"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSNumeroEndereco">
        <xs:annotation><xs:documentation>Número no logradouro do endereço do destinatário.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="60"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSComplementoEndereco">
        <xs:annotation><xs:documentation>Complemento do endereço do destinatário.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="156"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSBairro">
        <xs:annotation><xs:documentation>Bairro do endereço do destinatário.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="60"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSCodMunIBGE">
        <xs:annotation><xs:documentation>Código do município do endereço do destinatário (Tabela do IBGE).</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:length value="7"/>
            <xs:pattern value="[0-9]{7}"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSCodPaisISO">
        <xs:annotation><xs:documentation>Código do país do endereço no exterior (Tabela de Países ISO).</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:length value="2"/>
            <xs:pattern value="[A-Z]{2}"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSCodigoEndPostal">
        <xs:annotation><xs:documentation>Código alfanumérico do Endereçamento Postal no exterior.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="11"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSCidadeExterior">
        <xs:annotation><xs:documentation>Nome da cidade no exterior do destinatário do serviço.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="60"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSEstadoProvRegExterior">
        <xs:annotation><xs:documentation>Estado, província ou região da cidade no exterior do destinatário do serviço.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="60"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSFone">
        <xs:annotation><xs:documentation>Número do telefone do destinatário.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:minLength value="6"/>
            <xs:maxLength value="20"/>
            <xs:pattern value="[0-9]{6,20}"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TSEmail">
        <xs:annotation><xs:documentation>E-mail do destinatário.</xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="80"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="TCDestinatario">
        <xs:annotation>
            <xs:documentation>Grupo de informações relativas ao Destinatário.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:choice>
                <xs:element name="CNPJ" type="nNFSE:TSCNPJ"/>
                <xs:element name="CPF" type="nNFSE:TSCPF"/>
                <xs:element name="NIF" type="nNFSE:TSNIF"/>
            </xs:choice>
            <xs:element name="cnaoNIF" type="nNFSE:TSCodNaoNIF"/>
            <xs:element name="xNome" type="nNFSE:TSNomeEmpresarial"/>
            <xs:element name="end" type="nNFSE:TCEnderecoDest"/>
            <xs:element name="fone" type="nNFSE:TSFone" minOccurs="0"/>
            <xs:element name="email" type="nNFSE:TSEmail" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="TCEnderecoDest">
        <xs:annotation>
            <xs:documentation>Grupo de informações do endereço do destinatário.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="xLgr" type="nNFSE:TSLogradouro"/>
            <xs:element name="nro" type="nNFSE:TSNumeroEndereco"/>
            <xs:element name="xCpl" type="nNFSE:TSComplementoEndereco" minOccurs="0"/>
            <xs:element name="xBairro" type="nNFSE:TSBairro"/>
            <xs:choice>
                <xs:element name="endNac" type="nNFSE:TCEnderNac"/>
                <xs:element name="endExt" type="nNFSE:TCEnderExt"/>
            </xs:choice>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="TCEnderNac">
        <xs:annotation>
            <xs:documentation>Grupo de informações do endereço nacional.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="cMun" type="nNFSE:TSCodMunIBGE"/>
            <xs:element name="CEP" type="nNFSE:TSCEP"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="TCEnderExt">
        <xs:annotation>
            <xs:documentation>Grupo de informações do endereço no exterior.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="cPais" type="nNFSE:TSCodPaisISO"/>
            <xs:element name="cEndPost" type="nNFSE:TSCodigoEndPostal"/>
            <xs:element name="xCidade" type="nNFSE:TSCidadeExterior"/>
            <xs:element name="xEstProvReg" type="nNFSE:TSEstadoProvRegExterior"/>
        </xs:sequence>
    </xs:complexType>
    






    <xs:simpleType name="TSFinNfse">
        <xs:annotation>
            <xs:documentation>Indicador da finalidade da emissão de NFS-e.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="1"/>
            <xs:pattern value="[0-9]"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="TSIndFinal">
        <xs:annotation>
            <xs:documentation>Indica operação de uso ou consumo pessoal.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="1"/>
            <xs:pattern value="[0-9]"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="TSCIndOp">
        <xs:annotation>
            <xs:documentation>Código indicador da operação de fornecimento.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="6"/>
            <xs:pattern value="[0-9]{1,6}"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    

    <xs:simpleType name="TSTpOper">
        <xs:annotation>
            <xs:documentation>Tipo de Operação com Entes Governanementais ou outros serviços sobre bens imóveis.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="1"/>
            <xs:pattern value="[0-9]"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>



    

            <xs:element name="TCGRefNfse" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="refNFSe" minOccurs="1" maxOccurs="99">
                            <xs:annotation>
                                <xs:documentation>Chave da NFS-e referenciada</xs:documentation>
                            </xs:annotation>
                            <xs:simpleType>
                                <xs:restriction base="xs:string">
                                    <xs:maxLength value="50"/>
                                </xs:restriction>
                            </xs:simpleType>
                        </xs:element>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>




    <xs:simpleType name="TSTpEnteGov">
        <xs:annotation>
            <xs:documentation>Tipo de ente governamental.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="1"/>
            <xs:pattern value="[0-9]"/>
            <xs:whiteSpace value="collapse"/>
        </xs:restriction>
    </xs:simpleType>
    
    <xs:simpleType name="TSIndDest">
        <xs:annotation>
            <xs:documentation>A respeito do Destinatário dos serviços.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="1"/>
            <xs:pattern value="[0-1]"/>
        </xs:restriction>
    </xs:simpleType>
    



    <xs:complexType name="TCDpsIBSCBS">
        <xs:annotation>
            <xs:documentation>Grupo de informações declaradas pelo emitente referentes ao IBS e à CBS-DPS TINUS203.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="finNfse" type="nfse:TSFinNfse"  minOccurs="1"/>
            <xs:element name="indFinal" type="nfse:TSIndFinal"  minOccurs="1"/>
            <xs:element name="cIndOp" type="nfse:TSCIndOp"  minOccurs="1"/>
            <xs:element name="tpOper" type="nfse:TSTpOper" minOccurs="0"/>
            
            <xs:element name="gRefNfse" type="nfse:TCGRefNfse" minOccurs="0"/> 
            
            <xs:element name="tpEnteGov" type="nfse:TSTpEnteGov" minOccurs="0"/>
            <xs:element name="indDest" type="nfse:TSIndDest" minOccurs="1"/>

            <xs:element name="dest" type="nNFSE:TCDestinatario"  minOccurs="0"/>

	    <xs:element name="imovel" type="nNFSE:TCImovel"   minOccurs="0"/>

	    <xs:element name="valores" type="nfse:TCInfoValoresIBSCBS" minOccurs="1"/>

        </xs:sequence>
    </xs:complexType>

    <xs:element name="IBSCBS" type="nfse:TCDpsIBSCBS"/>





</xs:schema>