<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ctaconsult.com/nfse" elementFormDefault="qualified" attributeFormDefault="unqualified" >

	<xs:simpleType name="TUf">
		<xs:annotation>
			<xs:documentation>Tipo Sigla da UF // acrescentado em 24/10/08 </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="TCodMunSerpro">
		<xs:annotation>
			<xs:documentation>Tipo Código do Município da tabela do SERPRO</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:pattern value="[0-9]{1,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:maxLength value="14"/>
			<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:maxLength value="11"/>
			<xs:pattern value="[0-9]{11}"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TBoolean">
		<xs:annotation>
			<xs:documentation>Confirmacao 1- Sim, 2 - Nao</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="TAmb">
		<xs:annotation>
			<xs:documentation>Tipo Ambiente</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="TTipoPessoa">
		<xs:annotation>
			<xs:documentation>1- Pessoa Fisica, 2 - Juridica</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="TNota">
		<xs:annotation>
			<xs:documentation>Tipo Nota 1- NFSe; 2 - NFSe-a</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="TDateTimeUTC">
		<xs:annotation>
			<xs:documentation>Data e Hora, formato UTC (AAAA-MM-DDThh: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)))))T(([0-1][0-9])|([2][0-3])):([0-5][0-9]):([0-5][0-9])"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TDec_1302">
		<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:decimal">
			<xs:totalDigits value="15"/><xs:fractionDigits value="2"/><xs:minInclusive value="0"/>
			<xs:pattern value="0|0\.[0-9]{2}|[1-9]{1}[0-9]{0,12}(\.[0-9]{0,2})?"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="TDec_1302Opc">
		<xs:annotation>
			<xs:documentation>Tipo Decimal com 15 dígitos, sendo 13 de corpo e 2 decimais, utilizado em tags opcionais</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:pattern value="0\.[0-9]{1}[1-9]{1}|0\.[1-9]{1}[0-9]{1}|[1-9]{1}[0-9]{0,12}(\.[0-9]{2})?"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TInscricaoMunicipal">
		<xs:annotation>
			<xs:documentation>Tipo Inscrição Municipal// alterado EM 24/10/08 para aceitar ISENTO</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:maxLength value="16"/>
			<xs:pattern value="[0-9]{2,16}"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TTipoLogradouro">
		<xs:annotation>
			<xs:documentation>Tipo Logradouro de acordo com a tabela</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:maxLength value="9"/>
			<xs:pattern value="[0-9]"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TDec_0204v">
		<xs:annotation>
			<xs:documentation>Tipo Decimal com até 2 dígitos inteiros, podendo ter de 1 até 4 decimais</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:pattern value="0|0\.[0-9]{1,4}|[0-9]{1}[0-9]{0,1}(\.[0-9]{1,4})?"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TCEP">
		<xs:annotation>
			<xs:documentation>Tipo CEP.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:pattern value="[0-9]{8,8}" />
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TCodigoAtividade">
		<xs:annotation>
			<xs:documentation>Código da atividade CNAE
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="[0-9]{9}" />
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="TCodigoServico">
		<xs:annotation>
			<xs:documentation>Código de serviço.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="[0-9]{4,5}" />
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TNumeroNota">
		<xs:annotation>
			<xs:documentation>Numero da nota</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="[0-9]{1,7}" />
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TTipoRecolhimento">
		<xs:annotation>
			<xs:documentation>Tipo recolhimento 1 - PRÓPRIO, 2 - RETIDO, 3 - ISENTO DE RECOLHIMENTO</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:enumeration value="1"/>
			<xs:enumeration value="2"/>
			<xs:enumeration value="3"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TTipoTributacao">
		<xs:annotation>
			<xs:documentation>Tipo tributacao 1 - Isento de ISSQN, 2 - IMUNE, 3 - EXIGIBILIDADE SUSPENSA, 4 - TRIBUTÁVEL, 5 - NÃO INCIDENTE NO MUNICÍPIO, 6 - TRIBUTÁVEL S.N., 7 - TRIBUTÁVEL FIXO, 8 - NÃO TRIBUTÁVEL, 9 - TRIBUTÁVEL MEI</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:enumeration value="1"/>
			<xs:enumeration value="2"/>
			<xs:enumeration value="3"/>
			<xs:enumeration value="4"/>
			<xs:enumeration value="5"/>
			<xs:enumeration value="6"/>
			<xs:enumeration value="7"/>
			<xs:enumeration value="8"/>
			<xs:enumeration value="9"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TTipoDeducao">
		<xs:annotation>
			<xs:documentation>Tipo recolhimento 1 - SEM DEDUÇÃO, 2 - MAPA DE MATERIAIS, 3 - PERCENTUAL, 4 - POR VALOR, 5 - PERCENTUAL / MAPA DE MATERIAIS, 6 - PUBLICIDADE, 7 - MAPA DE DEDUÇÕES PARA INTERMEDIAÇÃO</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:enumeration value="1"/>
			<xs:enumeration value="2"/>
			<xs:enumeration value="3"/>
			<xs:enumeration value="4"/>
			<xs:enumeration value="5"/>
			<xs:enumeration value="6"/>
			<xs:enumeration value="7"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TTipoItemDeducao">
		<xs:annotation>
			<xs:documentation>Tipo recolhimento 1 - DESPESAS COM MATERIAIS, 2 - DESPESAS COM SUBEMPREITADA, 3 - VEICULAÇÃO E PUBLICIDADE, 4 - SERVIÇOS</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:enumeration value="1"/>
			<xs:enumeration value="2"/>
			<xs:enumeration value="3"/>
			<xs:enumeration value="4"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TTipoValorDeducao">
		<xs:annotation>
			<xs:documentation>Tipo recolhimento 1 - Valor, 2 - Percentual</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="TTipoValorImpostos">
		<xs:annotation>
			<xs:documentation>Tipo recolhimento 1 - Valor, 2 - Aliquota</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="TCodigoImpostoFederal">
		<xs:annotation>
			<xs:documentation>Codigo do imposto 1-PIS, 2-COFINS, 3-INSS, 4-IR, 5-CSLL </xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:enumeration value="1"/>
			<xs:enumeration value="2"/>
			<xs:enumeration value="3"/>
			<xs:enumeration value="4"/>
			<xs:enumeration value="5"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TToken">
		<xs:annotation>
			<xs:documentation>Numero do token</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:length value="32" />
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TNumero2">
		<xs:annotation>
			<xs:documentation>Numero </xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:maxLength value="2"/>
			<xs:pattern value="[0-9]{1,2}"/>
		</xs:restriction>
	</xs:simpleType>


	<xs:simpleType name="TNumero4">
		<xs:annotation>
			<xs:documentation>Numero </xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:maxLength value="4"/>
			<xs:pattern value="[0-9]{1,4}"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="TNumero9">
		<xs:annotation>
			<xs:documentation>Numero </xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:maxLength value="9"/>
			<xs:pattern value="[0-9]{1,9}"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
