<?xml version="1.0" encoding="utf-8" ?>
<xs:schema 
	attributeFormDefault="unqualified" 
	elementFormDefault="qualified" 
	targetNamespace="http://www.gnre.pe.gov.br" 
	xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:simpleType name="TCodMunIBGE">
    <xs:annotation>
      <xs:documentation>Tipo Código do Município da tabela do IBGE</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:pattern value="[0-9]{5}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TCnpj">
    <xs:annotation>
      <xs:documentation>Tipo Número do CNPJ</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:pattern value="[0-9]{14}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TCpf">
    <xs:annotation>
      <xs:documentation>Tipo Número do CPF</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:pattern value="[0-9]{11}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TIe">
    <xs:annotation>
      <xs:documentation>Tipo Inscrição Estadual</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:pattern value="[0-9]{2,16}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TUf">
    <xs:annotation>
      <xs:documentation>Tipo Sigla da UF </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:enumeration value="AC" />
      <xs:enumeration value="AL" />
      <xs:enumeration value="AM" />
      <xs:enumeration value="AP" />
      <xs:enumeration value="BA" />
      <xs:enumeration value="CE" />
      <xs:enumeration value="DF" />
      <xs:enumeration value="ES" />
      <xs:enumeration value="GO" />
      <xs:enumeration value="MA" />
      <xs:enumeration value="MG" />
      <xs:enumeration value="MS" />
      <xs:enumeration value="MT" />
      <xs:enumeration value="PA" />
      <xs:enumeration value="PB" />
      <xs:enumeration value="PE" />
      <xs:enumeration value="PI" />
      <xs:enumeration value="PR" />
      <xs:enumeration value="RJ" />
      <xs:enumeration value="RN" />
      <xs:enumeration value="RO" />
      <xs:enumeration value="RR" />
      <xs:enumeration value="RS" />
      <xs:enumeration value="SC" />
      <xs:enumeration value="SE" />
      <xs:enumeration value="SP" />
      <xs:enumeration value="TO" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TVerAplic">
    <xs:annotation>
      <xs:documentation>Tipo Versão do Aplicativo</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:minLength value="1" />
      <xs:maxLength value="20" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TAno">
    <xs:annotation>
      <xs:documentation> Tipo ano</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:pattern value="[1-9]{1}[0-9]{1}[0-9]{1}[0-9]{1}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TString">
    <xs:annotation>
      <xs:documentation> Tipo string genérico</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:pattern value="[!-ÿ]{1}[ -ÿ]{0,}[!-ÿ]{1}|[!-ÿ]{1}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TData">
    <xs:annotation>
      <xs:documentation> Tipo data AAAA-MM-DD</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:pattern value="(((20(([02468][048])|([13579][26]))-02-29))|(20[0-9][0-9])-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30)))))" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TDataHora" >
    <xs:annotation>
      <xs:documentation> Tipo data AAAA-MM-DD HH:MM:SS</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:pattern value="(((20(([02468][048])|([13579][26]))-02-29))|(20[0-9][0-9])-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30))))) [0-5][0-9]:[0-5][0-9]:[0-5][0-9]" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TMes">
    <xs:annotation>
      <xs:documentation>Tipo Meses do Ano</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:enumeration value="01" />
      <xs:enumeration value="02" />
      <xs:enumeration value="03" />
      <xs:enumeration value="04" />
      <xs:enumeration value="05" />
      <xs:enumeration value="06" />
      <xs:enumeration value="07" />
      <xs:enumeration value="08" />
      <xs:enumeration value="09" />
      <xs:enumeration value="10" />
      <xs:enumeration value="11" />
      <xs:enumeration value="12" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TCamposGNRE">
    <xs:annotation>
      <xs:documentation>Tipo Campos possíveis na GNRE</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:enumeration value="c01_UfFavorecida" />
      <xs:enumeration value="c02_receita" />
      <xs:enumeration value="c25_detalhamentoReceita" />
      <xs:enumeration value="c26_produto" />
      <xs:enumeration value="c27_tipoIdentificacaoEmitente" />
      <xs:enumeration value="c03_idContribuinteEmitente" />
      <xs:enumeration value="c28_tipoDocOrigem" />
      <xs:enumeration value="c04_docOrigem" />
      <xs:enumeration value="c06_valorPrincipal" />
      <xs:enumeration value="c07_atualizacaoMonetaria" />
      <xs:enumeration value="c08_juros" />
      <xs:enumeration value="c09_multa" />
      <xs:enumeration value="c10_valorTotal" />
      <xs:enumeration value="c14_dataVencimento" />
      <xs:enumeration value="c33_dataPagamento" />
      <xs:enumeration value="c29_dataLimitePagamento" />
      <xs:enumeration value="c15_convenio" />
      <xs:enumeration value="c16_razaoSocialEmitente" />
      <xs:enumeration value="c17_inscricaoEstadualEmitente" />
      <xs:enumeration value="c18_enderecoEmitente" />
      <xs:enumeration value="c19_municipioEmitente" />
      <xs:enumeration value="c20_ufEnderecoEmitente" />
      <xs:enumeration value="c21_cepEmitente" />
      <xs:enumeration value="c22_telefoneEmitente" />
      <xs:enumeration value="c34_tipoIdentificacaoDestinatario" />
      <xs:enumeration value="c35_idContribuinteDestinatario" />
      <xs:enumeration value="c36_inscricaoEstadualDestinatario" />
      <xs:enumeration value="c37_razaoSocialDestinatario" />
      <xs:enumeration value="c38_municipioDestinatario" />
      <xs:enumeration value="c30_nossoNumero" />
      <xs:enumeration value="c05_referencia" />
      <xs:enumeration value="periodo" />
      <xs:enumeration value="mes" />
      <xs:enumeration value="ano" />
      <xs:enumeration value="parcela" />
      <xs:enumeration value="c39_camposExtras" />
      <xs:enumeration value="campoExtra" />
      <xs:enumeration value="codigo" />
      <xs:enumeration value="tipo" />
      <xs:enumeration value="valor" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TVerGNRE">
    <xs:annotation>
      <xs:documentation> Tipo Versão da GNRE - 1.10</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:pattern value="1\.00" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TIdentificacao">
    <xs:annotation>
      <xs:documentation>Código do Tipo de Identificação do Destinatário:
							1 - CNPJ;
							2 - CPF;
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:enumeration value="1" />
      <xs:enumeration value="2" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TDec_1502">
    <xs:annotation>
      <xs:documentation>Tipo Decimal com 15 dígitos, sendo 13 de corpo e 2 decimais</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:pattern value="0|0\.[0-9]{2}|[1-9]{1}[0-9]{0,9}(\.[0-9]{2})?" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TTipoCampoExtra">
  	<xs:annotation>
  		<xs:documentation>Código do tipo de dados dos Campos Extras:
	T - Texto
	N - Numérico
	D - Data
  		</xs:documentation>
  	</xs:annotation>
  	<xs:restriction base="xs:string">
  		<xs:enumeration value="T"></xs:enumeration>
  		<xs:enumeration value="N"></xs:enumeration>
  		<xs:enumeration value="D"></xs:enumeration>
  	</xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TSimNao">
  	<xs:restriction base="xs:string">
  		<xs:enumeration value="S"></xs:enumeration>
  		<xs:enumeration value="N"></xs:enumeration>
  	</xs:restriction>
  </xs:simpleType>
</xs:schema>