br_nfe 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/.travis.yml +8 -0
  4. data/Gemfile +16 -0
  5. data/Gemfile.lock +27 -3
  6. data/LICENSE +1 -1
  7. data/README.markdown +10 -12
  8. data/Rakefile +13 -0
  9. data/br_nfe.gemspec +18 -21
  10. data/lib/br_nfe/active_model_base.rb +7 -1
  11. data/lib/br_nfe/base.rb +175 -37
  12. data/lib/br_nfe/endereco.rb +7 -1
  13. data/lib/br_nfe/helper/have_rps.rb +1 -1
  14. data/lib/br_nfe/helper/values_ts/service_v1.rb +313 -0
  15. data/lib/br_nfe/response/service/build_response.rb +286 -0
  16. data/lib/br_nfe/response/service/default.rb +185 -0
  17. data/lib/br_nfe/{servico/response → response/service}/nota_fiscal.rb +11 -10
  18. data/lib/br_nfe/response/service/paths/base.rb +93 -0
  19. data/lib/br_nfe/response/service/paths/v1/servico_cancelar_nfse_resposta.rb +22 -0
  20. data/lib/br_nfe/response/service/paths/v1/servico_consultar_lote_rps_resposta.rb +25 -0
  21. data/lib/br_nfe/response/service/paths/v1/servico_consultar_nfse_resposta.rb +25 -0
  22. data/lib/br_nfe/response/service/paths/v1/servico_consultar_nfse_rps_resposta.rb +25 -0
  23. data/lib/br_nfe/response/service/paths/v1/servico_consultar_situacao_lote_rps_resposta.rb +31 -0
  24. data/lib/br_nfe/response/service/paths/v1/servico_enviar_lote_rps_resposta.rb +36 -0
  25. data/lib/br_nfe/response/service/paths/v1/tc_nfse.rb +127 -0
  26. data/lib/br_nfe/service/base.rb +59 -0
  27. data/lib/br_nfe/service/betha/base.rb +8 -0
  28. data/lib/br_nfe/service/betha/v1/cancelamento_nfs.rb +39 -0
  29. data/lib/br_nfe/service/betha/v1/consulta_lote_rps.rb +34 -0
  30. data/lib/br_nfe/service/betha/v1/consulta_nfs_por_rps.rb +32 -0
  31. data/lib/br_nfe/service/betha/v1/consulta_nfse.rb +32 -0
  32. data/lib/br_nfe/service/betha/v1/consulta_situacao_lote_rps.rb +30 -0
  33. data/lib/br_nfe/service/betha/v1/gateway.rb +21 -0
  34. data/lib/br_nfe/service/betha/v1/recepcao_lote_rps.rb +37 -0
  35. data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_lote_rps_resposta.rb +19 -0
  36. data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_resposta.rb +17 -0
  37. data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_rps_resposta.rb +17 -0
  38. data/lib/br_nfe/service/concerns/rules/cancelamento_nfs.rb +20 -0
  39. data/lib/br_nfe/service/concerns/rules/consulta_nfs_por_rps.rb +18 -0
  40. data/lib/br_nfe/service/concerns/rules/consulta_nfse.rb +29 -0
  41. data/lib/br_nfe/service/concerns/rules/recepcao_lote_rps.rb +50 -0
  42. data/lib/br_nfe/{servico → service}/intermediario.rb +1 -1
  43. data/lib/br_nfe/service/item.rb +70 -0
  44. data/lib/br_nfe/service/rps.rb +231 -0
  45. data/lib/br_nfe/service/sc/florianopolis/base.rb +25 -0
  46. data/lib/br_nfe/service/sc/florianopolis/cancellation.rb +30 -0
  47. data/lib/br_nfe/service/sc/florianopolis/emission_rps.rb +19 -0
  48. data/lib/br_nfe/service/sc/florianopolis/xml/_address.xml.slim +21 -0
  49. data/lib/br_nfe/service/sc/florianopolis/xml/_contact.xml.slim +3 -0
  50. data/lib/br_nfe/service/sc/florianopolis/xml/_service_item.xml.slim +9 -0
  51. data/lib/br_nfe/service/sc/florianopolis/xml/cancellation.xml.slim +6 -0
  52. data/lib/br_nfe/service/sc/florianopolis/xml/inf_requisicao.xml.slim +55 -0
  53. data/lib/br_nfe/service/sc/gaspar/cancela_nfse.rb +13 -0
  54. data/lib/br_nfe/service/sc/gaspar/consulta_lote_rps.rb +13 -0
  55. data/lib/br_nfe/service/sc/gaspar/consulta_nfs_por_rps.rb +13 -0
  56. data/lib/br_nfe/service/sc/gaspar/consulta_nfse.rb +17 -0
  57. data/lib/br_nfe/service/sc/gaspar/consulta_situacao_lote_rps.rb +13 -0
  58. data/lib/br_nfe/service/sc/gaspar/recepcao_lote_rps.rb +13 -0
  59. data/lib/br_nfe/service/sc/gaspar/recepcao_lote_rps_limitado.rb +13 -0
  60. data/lib/br_nfe/service/thema/v1/base.rb +55 -0
  61. data/lib/br_nfe/service/thema/v1/cancela_nfse.rb +48 -0
  62. data/lib/br_nfe/service/thema/v1/consulta_lote_rps.rb +49 -0
  63. data/lib/br_nfe/service/thema/v1/consulta_nfs_por_rps.rb +48 -0
  64. data/lib/br_nfe/service/thema/v1/consulta_nfse.rb +47 -0
  65. data/lib/br_nfe/service/thema/v1/consulta_situacao_lote_rps.rb +46 -0
  66. data/lib/br_nfe/service/thema/v1/recepcao_lote_rps.rb +51 -0
  67. data/lib/br_nfe/service/thema/v1/recepcao_lote_rps_limitado.rb +30 -0
  68. data/lib/br_nfe/service/xml/v1/_tc_contato.xml.slim +7 -0
  69. data/lib/br_nfe/service/xml/v1/_tc_cpf_cnpj.xml.slim +5 -0
  70. data/lib/br_nfe/service/xml/v1/_tc_dados_construcao_civil.xml.slim +2 -0
  71. data/lib/br_nfe/service/xml/v1/_tc_dados_prestador.xml.slim +15 -0
  72. data/lib/br_nfe/service/xml/v1/_tc_dados_servico.xml.slim +14 -0
  73. data/lib/br_nfe/service/xml/v1/_tc_dados_tomador.xml.slim +15 -0
  74. data/lib/br_nfe/service/xml/v1/_tc_endereco.xml.slim +13 -0
  75. data/lib/br_nfe/service/xml/v1/_tc_identificacao_intermediario_servico.xml.slim +7 -0
  76. data/lib/br_nfe/service/xml/v1/_tc_identificacao_nfse.xml.slim +7 -0
  77. data/lib/br_nfe/service/xml/v1/_tc_identificacao_orgao_gerador.xml.slim +8 -0
  78. data/lib/br_nfe/service/xml/v1/_tc_identificacao_prestador.xml.slim +3 -0
  79. data/lib/br_nfe/service/xml/v1/_tc_identificacao_rps.xml.slim +16 -0
  80. data/lib/br_nfe/service/xml/v1/_tc_identificacao_tomador.xml.slim +4 -0
  81. data/lib/br_nfe/service/xml/v1/_tc_inf_pedido_cancelamento.xml.slim +4 -0
  82. data/lib/br_nfe/service/xml/v1/_tc_inf_rps.xml.slim +47 -0
  83. data/lib/br_nfe/service/xml/v1/_tc_lote_rps.xml.slim +9 -0
  84. data/lib/br_nfe/service/xml/v1/_tc_pedido_cancelamento.xml.slim +4 -0
  85. data/lib/br_nfe/service/xml/v1/_tc_rps.xml.slim +8 -0
  86. data/lib/br_nfe/service/xml/v1/_tc_valores.xml.slim +48 -0
  87. data/lib/br_nfe/service/xml/v1/servico_cancelar_nfse_envio.xml.slim +9 -0
  88. data/lib/br_nfe/service/xml/v1/servico_consultar_lote_rps_envio.xml.slim +4 -0
  89. data/lib/br_nfe/service/xml/v1/servico_consultar_nfse_envio.xml.slim +19 -0
  90. data/lib/br_nfe/service/xml/v1/servico_consultar_nfse_rps_envio.xml.slim +5 -0
  91. data/lib/br_nfe/service/xml/v1/servico_consultar_situacao_lote_rps_envio.xml.slim +4 -0
  92. data/lib/br_nfe/service/xml/v1/servico_enviar_lote_rps_envio.xml.slim +9 -0
  93. data/lib/br_nfe/version.rb +2 -2
  94. data/lib/br_nfe/xml/_signed_info_sh1.xml.slim +9 -0
  95. data/lib/br_nfe/xml/signature_sh1.xml.slim +12 -0
  96. data/lib/br_nfe/xml/soap_env.xml.slim +3 -0
  97. data/lib/br_nfe.rb +72 -20
  98. data/test/br_nfe/base_test.rb +257 -108
  99. data/test/br_nfe/helper/have_intermediario_test.rb +2 -2
  100. data/test/br_nfe/helper/have_rps_test.rb +4 -4
  101. data/test/br_nfe/response/service/build_response_test.rb +377 -0
  102. data/test/br_nfe/response/service/default_test.rb +218 -0
  103. data/test/br_nfe/{servico/response → response/service}/nota_fiscal_test.rb +2 -2
  104. data/test/br_nfe/response/service/paths/base_test.rb +199 -0
  105. data/test/br_nfe/response/service/paths/v1/servico_cancelar_nfse_resposta_test.rb +25 -0
  106. data/test/br_nfe/response/service/paths/v1/servico_consultar_lote_rps_resposta_test.rb +30 -0
  107. data/test/br_nfe/response/service/paths/v1/servico_consultar_nfse_resposta_test.rb +30 -0
  108. data/test/br_nfe/response/service/paths/v1/servico_consultar_nfse_rps_resposta_test.rb +30 -0
  109. data/test/br_nfe/response/service/paths/v1/servico_consultar_situacao_lote_rps_resposta_test.rb +30 -0
  110. data/test/br_nfe/response/service/paths/v1/servico_enviar_lote_rps_resposta_test.rb +34 -0
  111. data/test/br_nfe/response/service/paths/v1/tc_nfse_test.rb +122 -0
  112. data/test/br_nfe/service/base_test.rb +138 -0
  113. data/test/br_nfe/service/betha/base_test.rb +9 -0
  114. data/test/br_nfe/service/betha/v1/cancelamento_nfs_test.rb +60 -0
  115. data/test/br_nfe/service/betha/v1/consulta_lote_rps_test.rb +55 -0
  116. data/test/br_nfe/service/betha/v1/consulta_nfs_por_rps_test.rb +55 -0
  117. data/test/br_nfe/service/betha/v1/consulta_nfse_test.rb +53 -0
  118. data/test/br_nfe/service/betha/v1/consulta_situacao_lote_rps_test.rb +49 -0
  119. data/test/br_nfe/service/betha/v1/gateway_test.rb +35 -0
  120. data/test/br_nfe/service/betha/v1/recepcao_lote_rps_test.rb +84 -0
  121. data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_lote_rps_resposta_test.rb +16 -0
  122. data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_resposta_test.rb +16 -0
  123. data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_rps_resposta_test.rb +16 -0
  124. data/test/br_nfe/service/betha/v1/xsd/TiposNFe_v01.xsd +583 -0
  125. data/test/br_nfe/service/betha/v1/xsd/nfse_v01.xsd +652 -0
  126. data/test/br_nfe/service/betha/v1/xsd/servico_cancelar_nfse_envio_v01.xsd +17 -0
  127. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_lote_rps_envio_v01.xsd +16 -0
  128. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_nfse_envio_v01.xsd +28 -0
  129. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_nfse_rps_envio_v01.xsd +16 -0
  130. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_situacao_lote_rps_envio_v01.xsd +16 -0
  131. data/test/br_nfe/service/betha/v1/xsd/servico_enviar_lote_rps_envio_v01.xsd +17 -0
  132. data/test/br_nfe/service/betha/v1/xsd/xmldsig-core-schema.xsd +308 -0
  133. data/test/br_nfe/service/betha/v1/xsd/xmldsig-core-schema_v01.xsd +95 -0
  134. data/test/br_nfe/service/concerns/rules/cancelamento_nfs_test.rb +15 -0
  135. data/test/br_nfe/service/concerns/rules/consulta_nfs_por_rps_test.rb +36 -0
  136. data/test/br_nfe/service/concerns/rules/consulta_nfse_test.rb +42 -0
  137. data/test/br_nfe/{servico/base_test.rb → service/concerns/rules/recepcao_lote_rps_test.rb} +12 -4
  138. data/test/br_nfe/{servico → service}/intermediario_test.rb +1 -1
  139. data/test/br_nfe/service/item_test.rb +34 -0
  140. data/test/br_nfe/{servico → service}/rps_test.rb +191 -43
  141. data/test/br_nfe/service/sc/florianopolis/XSD/TiposNFSe_v2.0.xsd +863 -0
  142. data/test/br_nfe/service/sc/florianopolis/XSD/xmldsig-core-schema.xsd +309 -0
  143. data/test/br_nfe/service/sc/florianopolis/base_test.rb +20 -0
  144. data/test/br_nfe/service/sc/florianopolis/cancellation_test.rb +36 -0
  145. data/test/br_nfe/service/sc/florianopolis/emission_rps_test.rb +145 -0
  146. data/test/br_nfe/service/sc/gaspar/cancela_nfse_test.rb +21 -0
  147. data/test/br_nfe/service/sc/gaspar/consulta_nfs_por_rps_test.rb +21 -0
  148. data/test/br_nfe/service/sc/gaspar/consulta_nfse_test.rb +21 -0
  149. data/test/br_nfe/service/sc/gaspar/consulta_situacao_lote_rps_test.rb +21 -0
  150. data/test/br_nfe/service/sc/gaspar/recepcao_lote_rps_limitado_test.rb +22 -0
  151. data/test/br_nfe/service/sc/gaspar/recepcao_lote_rps_test.rb +22 -0
  152. data/test/br_nfe/service/thema/v1/base_test.rb +65 -0
  153. data/test/br_nfe/service/thema/v1/cancela_nfse_test.rb +56 -0
  154. data/test/br_nfe/service/thema/v1/consulta_lote_rps_test.rb +47 -0
  155. data/test/br_nfe/service/thema/v1/consulta_nfs_por_rps_test.rb +50 -0
  156. data/test/br_nfe/service/thema/v1/consulta_nfse_test.rb +50 -0
  157. data/test/br_nfe/service/thema/v1/consulta_situacao_lote_rps_test.rb +47 -0
  158. data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test.rb +62 -0
  159. data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test_limitado.rb +50 -0
  160. data/test/br_nfe/service/thema/v1/xsd/nfse.xsd +656 -0
  161. data/test/br_nfe/service/thema/v1/xsd/xmldsig-core-schema20020212.xsd +318 -0
  162. data/test/br_nfe/service/xsd/v1/nfse.xsd +779 -0
  163. data/test/br_nfe/service/xsd/v1/xmldsig-core-schema20020212.xsd +316 -0
  164. data/test/cert.pfx +0 -0
  165. data/test/factories/base.rb +2 -0
  166. data/test/factories/destinatario.rb +3 -3
  167. data/test/factories/response/service/build_response.rb +5 -0
  168. data/test/factories/response/service/default.rb +10 -0
  169. data/test/factories/{servico/response → response/service}/nota_fiscal.rb +9 -9
  170. data/test/factories/service/base.rb +6 -0
  171. data/test/factories/service/betha/base.rb +4 -0
  172. data/test/factories/service/betha/v1/cancelamento_nfs.rb +9 -0
  173. data/test/factories/{servico → service}/betha/v1/consulta_lote_rps.rb +2 -2
  174. data/test/factories/{servico → service}/betha/v1/consulta_nfs_por_rps.rb +1 -1
  175. data/test/factories/service/betha/v1/consulta_nfse.rb +8 -0
  176. data/test/factories/{servico → service}/betha/v1/consulta_situacao_lote_rps.rb +2 -2
  177. data/test/factories/{servico → service}/betha/v1/gateway.rb +1 -1
  178. data/test/factories/service/betha/v1/recepcao_lote_rps.rb +8 -0
  179. data/test/factories/{servico → service}/intermediario.rb +2 -2
  180. data/test/factories/service/item.rb +12 -0
  181. data/test/factories/service/rps.rb +50 -0
  182. data/test/factories/service/sc/florianopolis/base.rb +5 -0
  183. data/test/factories/service/sc/florianopolis/cancellation.rb +7 -0
  184. data/test/factories/service/sc/florianopolis/emission_rps.rb +7 -0
  185. data/test/factories/service/sc/gaspar/cancela_nfse.rb +9 -0
  186. data/test/factories/service/sc/gaspar/consulta_lote_rps.rb +7 -0
  187. data/test/factories/service/sc/gaspar/consulta_nfs_por_rps.rb +6 -0
  188. data/test/factories/service/sc/gaspar/consulta_nfse.rb +8 -0
  189. data/test/factories/service/sc/gaspar/consulta_situacao_lote_rps.rb +6 -0
  190. data/test/factories/service/sc/gaspar/recepcao_lote_rps.rb +9 -0
  191. data/test/factories/service/sc/gaspar/recepcao_lote_rps_limitado.rb +9 -0
  192. data/test/factories/service/thema/v1/base.rb +7 -0
  193. data/test/factories/service/thema/v1/cancela_nfse.rb +9 -0
  194. data/test/factories/service/thema/v1/consulta_lote_rps.rb +7 -0
  195. data/test/factories/service/thema/v1/consulta_nfs_por_rps.rb +6 -0
  196. data/test/factories/service/thema/v1/consulta_nfse.rb +8 -0
  197. data/test/factories/service/thema/v1/consulta_situacao_lote_rps.rb +6 -0
  198. data/test/factories/service/thema/v1/recepcao_lote_rps.rb +9 -0
  199. data/test/factories/service/thema/v1/recepcao_lote_rps_limitado.rb +8 -0
  200. data/test/test_helper.rb +42 -0
  201. metadata +338 -121
  202. data/lib/br_nfe/servico/base.rb +0 -35
  203. data/lib/br_nfe/servico/betha/base.rb +0 -85
  204. data/lib/br_nfe/servico/betha/build_response.rb +0 -141
  205. data/lib/br_nfe/servico/betha/v1/build_response.rb +0 -121
  206. data/lib/br_nfe/servico/betha/v1/cancelamento_nfs.rb +0 -52
  207. data/lib/br_nfe/servico/betha/v1/consulta_lote_rps.rb +0 -33
  208. data/lib/br_nfe/servico/betha/v1/consulta_nfs_por_rps.rb +0 -37
  209. data/lib/br_nfe/servico/betha/v1/consulta_nfse.rb +0 -51
  210. data/lib/br_nfe/servico/betha/v1/consulta_situacao_lote_rps.rb +0 -18
  211. data/lib/br_nfe/servico/betha/v1/gateway.rb +0 -125
  212. data/lib/br_nfe/servico/betha/v1/recepcao_lote_rps.rb +0 -97
  213. data/lib/br_nfe/servico/betha/v2/build_response.rb +0 -159
  214. data/lib/br_nfe/servico/betha/v2/cancelamento_nfs.rb +0 -30
  215. data/lib/br_nfe/servico/betha/v2/consulta_lote_rps.rb +0 -30
  216. data/lib/br_nfe/servico/betha/v2/consulta_nfse_por_rps.rb +0 -27
  217. data/lib/br_nfe/servico/betha/v2/envio_lote_rps_sincrono.rb +0 -30
  218. data/lib/br_nfe/servico/betha/v2/gateway.rb +0 -230
  219. data/lib/br_nfe/servico/betha/v2/gera_nfse.rb +0 -30
  220. data/lib/br_nfe/servico/betha/v2/recepcao_lote_rps.rb +0 -52
  221. data/lib/br_nfe/servico/betha/v2/substituicao_nfse.rb +0 -43
  222. data/lib/br_nfe/servico/response/default.rb +0 -34
  223. data/lib/br_nfe/servico/rps.rb +0 -108
  224. data/test/br_nfe/servico/betha/base_test.rb +0 -135
  225. data/test/br_nfe/servico/betha/v1/build_response_test.rb +0 -557
  226. data/test/br_nfe/servico/betha/v1/cancelamento_nfs_test.rb +0 -72
  227. data/test/br_nfe/servico/betha/v1/consulta_lote_rps_test.rb +0 -46
  228. data/test/br_nfe/servico/betha/v1/consulta_nfs_por_rps_test.rb +0 -68
  229. data/test/br_nfe/servico/betha/v1/consulta_nfse_test.rb +0 -74
  230. data/test/br_nfe/servico/betha/v1/consulta_situacao_lote_rps_test.rb +0 -27
  231. data/test/br_nfe/servico/betha/v1/gateway_test.rb +0 -151
  232. data/test/br_nfe/servico/betha/v1/recepcao_lote_rps_test.rb +0 -249
  233. data/test/br_nfe/servico/betha/v2/cancelamento_nfs_test.rb +0 -44
  234. data/test/br_nfe/servico/betha/v2/consulta_lote_rps_test.rb +0 -38
  235. data/test/br_nfe/servico/betha/v2/consulta_nfse_por_rps_test.rb +0 -36
  236. data/test/br_nfe/servico/betha/v2/envio_lote_rps_sincrono_test.rb +0 -51
  237. data/test/br_nfe/servico/betha/v2/gateway_test.rb +0 -372
  238. data/test/br_nfe/servico/betha/v2/gera_nfse_test.rb +0 -62
  239. data/test/br_nfe/servico/betha/v2/recepcao_lote_rps_test.rb +0 -108
  240. data/test/br_nfe/servico/betha/v2/substituicao_nfse_test.rb +0 -84
  241. data/test/br_nfe/servico/response/default_test.rb +0 -54
  242. data/test/factories/servico/base.rb +0 -5
  243. data/test/factories/servico/betha/base.rb +0 -5
  244. data/test/factories/servico/betha/v1/build_response.rb +0 -6
  245. data/test/factories/servico/betha/v1/cancelamento_nfs.rb +0 -7
  246. data/test/factories/servico/betha/v1/consulta_nfse.rb +0 -8
  247. data/test/factories/servico/betha/v1/recepcao_lote_rps.rb +0 -6
  248. data/test/factories/servico/betha/v2/cancelamento_nfs.rb +0 -7
  249. data/test/factories/servico/betha/v2/consulta_lote_rps.rb +0 -6
  250. data/test/factories/servico/betha/v2/consulta_nfse_por_rps.rb +0 -6
  251. data/test/factories/servico/betha/v2/envio_lote_rps_sincrono.rb +0 -5
  252. data/test/factories/servico/betha/v2/gateway.rb +0 -5
  253. data/test/factories/servico/betha/v2/gera_nfse.rb +0 -6
  254. data/test/factories/servico/betha/v2/recepcao_lote_rps.rb +0 -5
  255. data/test/factories/servico/betha/v2/substituicao_nfse.rb +0 -8
  256. data/test/factories/servico/response/default.rb +0 -10
  257. data/test/factories/servico/rps.rb +0 -44
@@ -0,0 +1,318 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE schema
3
+ PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
4
+ [
5
+ <!ATTLIST schema
6
+ xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
7
+ <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
8
+ <!ENTITY % p ''>
9
+ <!ENTITY % s ''>
10
+ ]>
11
+
12
+ <!-- Schema for XML Signatures
13
+ http://www.w3.org/2000/09/xmldsig#
14
+ $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
15
+
16
+ Copyright 2001 The Internet Society and W3C (Massachusetts Institute
17
+ of Technology, Institut National de Recherche en Informatique et en
18
+ Automatique, Keio University). All Rights Reserved.
19
+ http://www.w3.org/Consortium/Legal/
20
+
21
+ This document is governed by the W3C Software License [1] as described
22
+ in the FAQ [2].
23
+
24
+ [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
25
+ [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
26
+ -->
27
+
28
+
29
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
30
+ xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
31
+ targetNamespace="http://www.w3.org/2000/09/xmldsig#"
32
+ version="0.1" elementFormDefault="qualified">
33
+
34
+ <!-- Basic Types Defined for Signatures -->
35
+
36
+ <simpleType name="CryptoBinary">
37
+ <restriction base="base64Binary">
38
+ </restriction>
39
+ </simpleType>
40
+
41
+ <!-- Start Signature -->
42
+
43
+ <element name="Signature" type="ds:SignatureType"/>
44
+ <complexType name="SignatureType">
45
+ <sequence>
46
+ <element ref="ds:SignedInfo"/>
47
+ <element ref="ds:SignatureValue"/>
48
+ <element ref="ds:KeyInfo" minOccurs="0"/>
49
+ <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
50
+ </sequence>
51
+ <attribute name="Id" type="ID" use="optional"/>
52
+ </complexType>
53
+
54
+ <element name="SignatureValue" type="ds:SignatureValueType"/>
55
+ <complexType name="SignatureValueType">
56
+ <simpleContent>
57
+ <extension base="base64Binary">
58
+ <attribute name="Id" type="ID" use="optional"/>
59
+ </extension>
60
+ </simpleContent>
61
+ </complexType>
62
+
63
+ <!-- Start SignedInfo -->
64
+
65
+ <element name="SignedInfo" type="ds:SignedInfoType"/>
66
+ <complexType name="SignedInfoType">
67
+ <sequence>
68
+ <element ref="ds:CanonicalizationMethod"/>
69
+ <element ref="ds:SignatureMethod"/>
70
+ <element ref="ds:Reference" maxOccurs="unbounded"/>
71
+ </sequence>
72
+ <attribute name="Id" type="ID" use="optional"/>
73
+ </complexType>
74
+
75
+ <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
76
+ <complexType name="CanonicalizationMethodType" mixed="true">
77
+ <sequence>
78
+ <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
79
+ <!-- (0,unbounded) elements from (1,1) namespace -->
80
+ </sequence>
81
+ <attribute name="Algorithm" type="anyURI" use="required"/>
82
+ </complexType>
83
+
84
+ <element name="SignatureMethod" type="ds:SignatureMethodType"/>
85
+ <complexType name="SignatureMethodType" mixed="true">
86
+ <sequence>
87
+ <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
88
+ <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
89
+ <!-- (0,unbounded) elements from (1,1) external namespace -->
90
+ </sequence>
91
+ <attribute name="Algorithm" type="anyURI" use="required"/>
92
+ </complexType>
93
+
94
+ <!-- Start Reference -->
95
+
96
+ <element name="Reference" type="ds:ReferenceType"/>
97
+ <complexType name="ReferenceType">
98
+ <sequence>
99
+ <element ref="ds:Transforms" minOccurs="0"/>
100
+ <element ref="ds:DigestMethod"/>
101
+ <element ref="ds:DigestValue"/>
102
+ </sequence>
103
+ <attribute name="Id" type="ID" use="optional"/>
104
+ <attribute name="URI" type="anyURI" use="optional"/>
105
+ <attribute name="Type" type="anyURI" use="optional"/>
106
+ </complexType>
107
+
108
+ <element name="Transforms" type="ds:TransformsType"/>
109
+ <complexType name="TransformsType">
110
+ <sequence>
111
+ <element ref="ds:Transform" maxOccurs="unbounded"/>
112
+ </sequence>
113
+ </complexType>
114
+
115
+ <element name="Transform" type="ds:TransformType"/>
116
+ <complexType name="TransformType" mixed="true">
117
+ <choice minOccurs="0" maxOccurs="unbounded">
118
+ <any namespace="##other" processContents="lax"/>
119
+ <!-- (1,1) elements from (0,unbounded) namespaces -->
120
+ <element name="XPath" type="string"/>
121
+ </choice>
122
+ <attribute name="Algorithm" type="anyURI" use="required"/>
123
+ </complexType>
124
+
125
+ <!-- End Reference -->
126
+
127
+ <element name="DigestMethod" type="ds:DigestMethodType"/>
128
+ <complexType name="DigestMethodType" mixed="true">
129
+ <sequence>
130
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
131
+ </sequence>
132
+ <attribute name="Algorithm" type="anyURI" use="required"/>
133
+ </complexType>
134
+
135
+ <element name="DigestValue" type="ds:DigestValueType"/>
136
+ <simpleType name="DigestValueType">
137
+ <restriction base="base64Binary"/>
138
+ </simpleType>
139
+
140
+ <!-- End SignedInfo -->
141
+
142
+ <!-- Start KeyInfo -->
143
+
144
+ <element name="KeyInfo" type="ds:KeyInfoType"/>
145
+ <complexType name="KeyInfoType" mixed="true">
146
+ <choice maxOccurs="unbounded">
147
+ <element ref="ds:KeyName"/>
148
+ <element ref="ds:KeyValue"/>
149
+ <element ref="ds:RetrievalMethod"/>
150
+ <element ref="ds:X509Data"/>
151
+ <element ref="ds:PGPData"/>
152
+ <element ref="ds:SPKIData"/>
153
+ <element ref="ds:MgmtData"/>
154
+ <any processContents="lax" namespace="##other"/>
155
+ <!-- (1,1) elements from (0,unbounded) namespaces -->
156
+ </choice>
157
+ <attribute name="Id" type="ID" use="optional"/>
158
+ </complexType>
159
+
160
+ <element name="KeyName" type="string"/>
161
+ <element name="MgmtData" type="string"/>
162
+
163
+ <element name="KeyValue" type="ds:KeyValueType"/>
164
+ <complexType name="KeyValueType" mixed="true">
165
+ <choice>
166
+ <element ref="ds:DSAKeyValue"/>
167
+ <element ref="ds:RSAKeyValue"/>
168
+ <any namespace="##other" processContents="lax"/>
169
+ </choice>
170
+ </complexType>
171
+
172
+ <element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
173
+ <complexType name="RetrievalMethodType">
174
+ <sequence>
175
+ <element ref="ds:Transforms" minOccurs="0"/>
176
+ </sequence>
177
+ <attribute name="URI" type="anyURI"/>
178
+ <attribute name="Type" type="anyURI" use="optional"/>
179
+ </complexType>
180
+
181
+ <!-- Start X509Data -->
182
+
183
+ <element name="X509Data" type="ds:X509DataType"/>
184
+ <complexType name="X509DataType">
185
+ <sequence maxOccurs="unbounded">
186
+ <choice>
187
+ <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
188
+ <element name="X509SKI" type="base64Binary"/>
189
+ <element name="X509SubjectName" type="string"/>
190
+ <element name="X509Certificate" type="base64Binary"/>
191
+ <element name="X509CRL" type="base64Binary"/>
192
+ <any namespace="##other" processContents="lax"/>
193
+ </choice>
194
+ </sequence>
195
+ </complexType>
196
+
197
+ <complexType name="X509IssuerSerialType">
198
+ <sequence>
199
+ <element name="X509IssuerName" type="string"/>
200
+ <element name="X509SerialNumber" type="integer"/>
201
+ </sequence>
202
+ </complexType>
203
+
204
+ <!-- End X509Data -->
205
+
206
+ <!-- Begin PGPData -->
207
+
208
+ <element name="PGPData" type="ds:PGPDataType"/>
209
+ <complexType name="PGPDataType">
210
+ <choice>
211
+ <sequence>
212
+ <element name="PGPKeyID" type="base64Binary"/>
213
+ <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
214
+ <any namespace="##other" processContents="lax" minOccurs="0"
215
+ maxOccurs="unbounded"/>
216
+ </sequence>
217
+ <sequence>
218
+ <element name="PGPKeyPacket" type="base64Binary"/>
219
+ <any namespace="##other" processContents="lax" minOccurs="0"
220
+ maxOccurs="unbounded"/>
221
+ </sequence>
222
+ </choice>
223
+ </complexType>
224
+
225
+ <!-- End PGPData -->
226
+
227
+ <!-- Begin SPKIData -->
228
+
229
+ <element name="SPKIData" type="ds:SPKIDataType"/>
230
+ <complexType name="SPKIDataType">
231
+ <sequence maxOccurs="unbounded">
232
+ <element name="SPKISexp" type="base64Binary"/>
233
+ <any namespace="##other" processContents="lax" minOccurs="0"/>
234
+ </sequence>
235
+ </complexType>
236
+
237
+ <!-- End SPKIData -->
238
+
239
+ <!-- End KeyInfo -->
240
+
241
+ <!-- Start Object (Manifest, SignatureProperty) -->
242
+
243
+ <element name="Object" type="ds:ObjectType"/>
244
+ <complexType name="ObjectType" mixed="true">
245
+ <sequence minOccurs="0" maxOccurs="unbounded">
246
+ <any namespace="##any" processContents="lax"/>
247
+ </sequence>
248
+ <attribute name="Id" type="ID" use="optional"/>
249
+ <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
250
+ <attribute name="Encoding" type="anyURI" use="optional"/>
251
+ </complexType>
252
+
253
+ <element name="Manifest" type="ds:ManifestType"/>
254
+ <complexType name="ManifestType">
255
+ <sequence>
256
+ <element ref="ds:Reference" maxOccurs="unbounded"/>
257
+ </sequence>
258
+ <attribute name="Id" type="ID" use="optional"/>
259
+ </complexType>
260
+
261
+ <element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
262
+ <complexType name="SignaturePropertiesType">
263
+ <sequence>
264
+ <element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
265
+ </sequence>
266
+ <attribute name="Id" type="ID" use="optional"/>
267
+ </complexType>
268
+
269
+ <element name="SignatureProperty" type="ds:SignaturePropertyType"/>
270
+ <complexType name="SignaturePropertyType" mixed="true">
271
+ <choice maxOccurs="unbounded">
272
+ <any namespace="##other" processContents="lax"/>
273
+ <!-- (1,1) elements from (1,unbounded) namespaces -->
274
+ </choice>
275
+ <attribute name="Target" type="anyURI" use="required"/>
276
+ <attribute name="Id" type="ID" use="optional"/>
277
+ </complexType>
278
+
279
+ <!-- End Object (Manifest, SignatureProperty) -->
280
+
281
+ <!-- Start Algorithm Parameters -->
282
+
283
+ <simpleType name="HMACOutputLengthType">
284
+ <restriction base="integer"/>
285
+ </simpleType>
286
+
287
+ <!-- Start KeyValue Element-types -->
288
+
289
+ <element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
290
+ <complexType name="DSAKeyValueType">
291
+ <sequence>
292
+ <sequence minOccurs="0">
293
+ <element name="P" type="ds:CryptoBinary"/>
294
+ <element name="Q" type="ds:CryptoBinary"/>
295
+ </sequence>
296
+ <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
297
+ <element name="Y" type="ds:CryptoBinary"/>
298
+ <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
299
+ <sequence minOccurs="0">
300
+ <element name="Seed" type="ds:CryptoBinary"/>
301
+ <element name="PgenCounter" type="ds:CryptoBinary"/>
302
+ </sequence>
303
+ </sequence>
304
+ </complexType>
305
+
306
+ <element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
307
+ <complexType name="RSAKeyValueType">
308
+ <sequence>
309
+ <element name="Modulus" type="ds:CryptoBinary"/>
310
+ <element name="Exponent" type="ds:CryptoBinary"/>
311
+ </sequence>
312
+ </complexType>
313
+
314
+ <!-- End KeyValue Element-types -->
315
+
316
+ <!-- End Signature -->
317
+
318
+ </schema>
@@ -0,0 +1,779 @@
1
+ <?xml version="1.0"?>
2
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
+ targetNamespace="http:/www.abrasf.org.br/nfse.xsd"
4
+ xmlns="http:/www.abrasf.org.br/nfse.xsd"
5
+ xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
6
+ attributeFormDefault="unqualified"
7
+ elementFormDefault="qualified">
8
+ <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema20020212.xsd"/>
9
+
10
+ <!-- definition of simple elements -->
11
+ <xsd:simpleType name="tsNumeroNfse">
12
+ <xsd:restriction base="xsd:nonNegativeInteger">
13
+ <xsd:totalDigits value="15"/>
14
+ </xsd:restriction>
15
+ </xsd:simpleType>
16
+ <xsd:simpleType name="tsCodigoVerificacao">
17
+ <xsd:restriction base="xsd:string">
18
+ <xsd:maxLength value="9"/>
19
+ <xsd:minLength value="1"/>
20
+ <xsd:whiteSpace value="collapse"/>
21
+ </xsd:restriction>
22
+ </xsd:simpleType>
23
+ <xsd:simpleType name="tsStatusRps">
24
+ <xsd:restriction base="xsd:byte">
25
+ <xsd:pattern value="1|2"/>
26
+ </xsd:restriction>
27
+ </xsd:simpleType>
28
+ <xsd:simpleType name="tsStatusNfse">
29
+ <xsd:restriction base="xsd:byte">
30
+ <xsd:pattern value="1|2"/>
31
+ </xsd:restriction>
32
+ </xsd:simpleType>
33
+ <xsd:simpleType name="tsNaturezaOperacao">
34
+ <xsd:restriction base="xsd:byte">
35
+ <xsd:pattern value="1|2|3|4|5|6"/>
36
+ </xsd:restriction>
37
+ </xsd:simpleType>
38
+ <xsd:simpleType name="tsRegimeEspecialTributacao">
39
+ <xsd:restriction base="xsd:byte">
40
+ <xsd:pattern value="1|2|3|4|5|6"/>
41
+ </xsd:restriction>
42
+ </xsd:simpleType>
43
+ <xsd:simpleType name="tsSimNao">
44
+ <xsd:restriction base="xsd:byte">
45
+ <xsd:pattern value="1|2"/>
46
+ </xsd:restriction>
47
+ </xsd:simpleType>
48
+ <xsd:simpleType name="tsNumeroRps">
49
+ <xsd:restriction base="xsd:nonNegativeInteger">
50
+ <xsd:totalDigits value="15"/>
51
+ </xsd:restriction>
52
+ </xsd:simpleType>
53
+ <xsd:simpleType name="tsSerieRps">
54
+ <xsd:restriction base="xsd:string">
55
+ <xsd:maxLength value="5"/>
56
+ <xsd:minLength value="1"/>
57
+ <xsd:whiteSpace value="collapse"/>
58
+ </xsd:restriction>
59
+ </xsd:simpleType>
60
+ <xsd:simpleType name="tsTipoRps">
61
+ <xsd:restriction base="xsd:byte">
62
+ <xsd:pattern value="1|2|3"/>
63
+ </xsd:restriction>
64
+ </xsd:simpleType>
65
+ <xsd:simpleType name="tsOutrasInformacoes">
66
+ <xsd:restriction base="xsd:string">
67
+ <xsd:maxLength value="255"/>
68
+ <xsd:minLength value="1"/>
69
+ <xsd:whiteSpace value="collapse"/>
70
+ </xsd:restriction>
71
+ </xsd:simpleType>
72
+ <xsd:simpleType name="tsValor">
73
+ <xsd:restriction base="xsd:decimal">
74
+ <xsd:totalDigits value="15"/>
75
+ <xsd:fractionDigits value="2" fixed="true"/>
76
+ <xsd:minInclusive value="0"/>
77
+ </xsd:restriction>
78
+ </xsd:simpleType>
79
+ <xsd:simpleType name="tsItemListaServico">
80
+ <xsd:restriction base="xsd:string">
81
+ <xsd:maxLength value="5"/>
82
+ <xsd:minLength value="1"/>
83
+ <xsd:whiteSpace value="collapse"/>
84
+ </xsd:restriction>
85
+ </xsd:simpleType>
86
+ <xsd:simpleType name="tsCodigoCnae">
87
+ <xsd:restriction base="xsd:int">
88
+ <xsd:totalDigits value="7"/>
89
+ </xsd:restriction>
90
+ </xsd:simpleType>
91
+ <xsd:simpleType name="tsCodigoTributacao">
92
+ <xsd:restriction base="xsd:string">
93
+ <xsd:maxLength value="20"/>
94
+ <xsd:minLength value="1"/>
95
+ <xsd:whiteSpace value="collapse"/>
96
+ </xsd:restriction>
97
+ </xsd:simpleType>
98
+ <xsd:simpleType name="tsAliquota">
99
+ <xsd:restriction base="xsd:decimal">
100
+ <xsd:totalDigits value="5"/>
101
+ <xsd:fractionDigits value="4"/>
102
+ <xsd:minInclusive value="0"/>
103
+ </xsd:restriction>
104
+ </xsd:simpleType>
105
+ <xsd:simpleType name="tsDiscriminacao">
106
+ <xsd:restriction base="xsd:string">
107
+ <xsd:maxLength value="2000"/>
108
+ <xsd:minLength value="1"/>
109
+ <xsd:whiteSpace value="collapse"/>
110
+ </xsd:restriction>
111
+ </xsd:simpleType>
112
+ <xsd:simpleType name="tsCodigoMunicipioIbge">
113
+ <xsd:restriction base="xsd:int">
114
+ <xsd:totalDigits value="7"/>
115
+ </xsd:restriction>
116
+ </xsd:simpleType>
117
+ <xsd:simpleType name="tsInscricaoMunicipal">
118
+ <xsd:restriction base="xsd:string">
119
+ <xsd:maxLength value="15"/>
120
+ <xsd:minLength value="1"/>
121
+ <xsd:whiteSpace value="collapse"/>
122
+ </xsd:restriction>
123
+ </xsd:simpleType>
124
+ <xsd:simpleType name="tsRazaoSocial">
125
+ <xsd:restriction base="xsd:string">
126
+ <xsd:maxLength value="115"/>
127
+ <xsd:minLength value="1"/>
128
+ <xsd:whiteSpace value="collapse"/>
129
+ </xsd:restriction>
130
+ </xsd:simpleType>
131
+ <xsd:simpleType name="tsNomeFantasia">
132
+ <xsd:restriction base="xsd:string">
133
+ <xsd:maxLength value="60"/>
134
+ <xsd:minLength value="1"/>
135
+ <xsd:whiteSpace value="collapse"/>
136
+ </xsd:restriction>
137
+ </xsd:simpleType>
138
+ <xsd:simpleType name="tsCnpj">
139
+ <xsd:restriction base="xsd:string">
140
+ <xsd:length value="14" fixed="true"/>
141
+ <xsd:whiteSpace value="collapse"/>
142
+ </xsd:restriction>
143
+ </xsd:simpleType>
144
+ <xsd:simpleType name="tsEndereco">
145
+ <xsd:restriction base="xsd:string">
146
+ <xsd:maxLength value="125"/>
147
+ <xsd:minLength value="1"/>
148
+ <xsd:whiteSpace value="collapse"/>
149
+ </xsd:restriction>
150
+ </xsd:simpleType>
151
+ <xsd:simpleType name="tsNumeroEndereco">
152
+ <xsd:restriction base="xsd:string">
153
+ <xsd:maxLength value="10"/>
154
+ <xsd:minLength value="1"/>
155
+ <xsd:whiteSpace value="collapse"/>
156
+ </xsd:restriction>
157
+ </xsd:simpleType>
158
+ <xsd:simpleType name="tsComplementoEndereco">
159
+ <xsd:restriction base="xsd:string">
160
+ <xsd:maxLength value="60"/>
161
+ <xsd:minLength value="1"/>
162
+ <xsd:whiteSpace value="collapse"/>
163
+ </xsd:restriction>
164
+ </xsd:simpleType>
165
+ <xsd:simpleType name="tsBairro">
166
+ <xsd:restriction base="xsd:string">
167
+ <xsd:maxLength value="60"/>
168
+ <xsd:minLength value="1"/>
169
+ <xsd:whiteSpace value="collapse"/>
170
+ </xsd:restriction>
171
+ </xsd:simpleType>
172
+ <xsd:simpleType name="tsUf">
173
+ <xsd:restriction base="xsd:string">
174
+ <xsd:length value="2" fixed="true"/>
175
+ </xsd:restriction>
176
+ </xsd:simpleType>
177
+ <xsd:simpleType name="tsCep">
178
+ <xsd:restriction base="xsd:int">
179
+ <xsd:totalDigits value="8" fixed="true"/>
180
+ </xsd:restriction>
181
+ </xsd:simpleType>
182
+ <xsd:simpleType name="tsEmail">
183
+ <xsd:restriction base="xsd:string">
184
+ <xsd:maxLength value="80"/>
185
+ <xsd:minLength value="1"/>
186
+ <xsd:whiteSpace value="collapse"/>
187
+ </xsd:restriction>
188
+ </xsd:simpleType>
189
+ <xsd:simpleType name="tsTelefone">
190
+ <xsd:restriction base="xsd:string">
191
+ <xsd:maxLength value="11"/>
192
+ <xsd:minLength value="1"/>
193
+ <xsd:whiteSpace value="collapse"/>
194
+ </xsd:restriction>
195
+ </xsd:simpleType>
196
+ <xsd:simpleType name="tsCpf">
197
+ <xsd:restriction base="xsd:string">
198
+ <xsd:length value="11" fixed="true"/>
199
+ </xsd:restriction>
200
+ </xsd:simpleType>
201
+ <xsd:simpleType name="tsIndicacaoCpfCnpj">
202
+ <xsd:restriction base="xsd:byte">
203
+ <xsd:pattern value="1|2|3"/>
204
+ </xsd:restriction>
205
+ </xsd:simpleType>
206
+ <xsd:simpleType name="tsCodigoObra">
207
+ <xsd:restriction base="xsd:string">
208
+ <xsd:maxLength value="15"/>
209
+ <xsd:minLength value="1"/>
210
+ <xsd:whiteSpace value="collapse"/>
211
+ </xsd:restriction>
212
+ </xsd:simpleType>
213
+ <xsd:simpleType name="tsArt">
214
+ <xsd:restriction base="xsd:string">
215
+ <xsd:maxLength value="15"/>
216
+ <xsd:minLength value="1"/>
217
+ <xsd:whiteSpace value="collapse"/>
218
+ </xsd:restriction>
219
+ </xsd:simpleType>
220
+ <xsd:simpleType name="tsNumeroLote">
221
+ <xsd:restriction base="xsd:nonNegativeInteger">
222
+ <xsd:totalDigits value="15"/>
223
+ </xsd:restriction>
224
+ </xsd:simpleType>
225
+ <xsd:simpleType name="tsNumeroProtocolo">
226
+ <xsd:restriction base="xsd:string">
227
+ <xsd:maxLength value="50"/>
228
+ </xsd:restriction>
229
+ </xsd:simpleType>
230
+ <xsd:simpleType name="tsSituacaoLoteRps">
231
+ <xsd:restriction base="xsd:byte">
232
+ <xsd:pattern value="1|2|3|4"/>
233
+ </xsd:restriction>
234
+ </xsd:simpleType>
235
+ <xsd:simpleType name="tsQuantidadeRps">
236
+ <xsd:restriction base="xsd:int">
237
+ </xsd:restriction>
238
+ </xsd:simpleType>
239
+ <xsd:simpleType name="tsCodigoMensagemAlerta">
240
+ <xsd:restriction base="xsd:string">
241
+ <xsd:maxLength value="4"/>
242
+ <xsd:minLength value="1"/>
243
+ <xsd:whiteSpace value="collapse"/>
244
+ </xsd:restriction>
245
+ </xsd:simpleType>
246
+ <xsd:simpleType name="tsDescricaoMensagemAlerta">
247
+ <xsd:restriction base="xsd:string">
248
+ <xsd:maxLength value="200"/>
249
+ <xsd:minLength value="1"/>
250
+ <xsd:whiteSpace value="collapse"/>
251
+ </xsd:restriction>
252
+ </xsd:simpleType>
253
+ <xsd:simpleType name="tsCodigoCancelamentoNfse">
254
+ <xsd:restriction base="xsd:string">
255
+ <xsd:maxLength value="4"/>
256
+ <xsd:minLength value="1"/>
257
+ <xsd:whiteSpace value="collapse"/>
258
+ </xsd:restriction>
259
+ </xsd:simpleType>
260
+ <xsd:simpleType name="tsIdTag">
261
+ <xsd:restriction base="xsd:string">
262
+ <xsd:maxLength value="255"/>
263
+ </xsd:restriction>
264
+ </xsd:simpleType>
265
+
266
+ <xsd:simpleType name="tsVersao">
267
+ <xsd:restriction base="xsd:token">
268
+ <xsd:pattern value="[1-9]{1}[0-9]{0,1}\.[0-9]{2}"/>
269
+ </xsd:restriction>
270
+ </xsd:simpleType>
271
+
272
+ <!-- definition of complex elements -->
273
+
274
+ <xsd:complexType name="tcCpfCnpj">
275
+ <xsd:choice>
276
+ <xsd:element name="Cpf" type="tsCpf" minOccurs="1" maxOccurs="1"/>
277
+ <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
278
+ </xsd:choice>
279
+ </xsd:complexType>
280
+ <xsd:complexType name="tcEndereco">
281
+ <xsd:sequence>
282
+ <xsd:element name="Endereco" type="tsEndereco" minOccurs="0" maxOccurs="1"/>
283
+ <xsd:element name="Numero" type="tsNumeroEndereco" minOccurs="0" maxOccurs="1"/>
284
+ <xsd:element name="Complemento" type="tsComplementoEndereco" minOccurs="0" maxOccurs="1"/>
285
+ <xsd:element name="Bairro" type="tsBairro" minOccurs="0" maxOccurs="1"/>
286
+ <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="0" maxOccurs="1"/>
287
+ <xsd:element name="Uf" type="tsUf" minOccurs="0" maxOccurs="1"/>
288
+ <xsd:element name="Cep" type="tsCep" minOccurs="0" maxOccurs="1"/>
289
+ </xsd:sequence>
290
+ </xsd:complexType>
291
+ <xsd:complexType name="tcContato">
292
+ <xsd:sequence>
293
+ <xsd:element name="Telefone" type="tsTelefone" minOccurs="0" maxOccurs="1"/>
294
+ <xsd:element name="Email" type="tsEmail" minOccurs="0" maxOccurs="1"/>
295
+ </xsd:sequence>
296
+ </xsd:complexType>
297
+ <xsd:complexType name="tcIdentificacaoOrgaoGerador">
298
+ <xsd:sequence>
299
+ <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"/>
300
+ <xsd:element name="Uf" type="tsUf" minOccurs="1" maxOccurs="1"/>
301
+ </xsd:sequence>
302
+ </xsd:complexType>
303
+ <xsd:complexType name="tcIdentificacaoRps">
304
+ <xsd:sequence>
305
+ <xsd:element name="Numero" type="tsNumeroRps" minOccurs="1" maxOccurs="1"/>
306
+ <xsd:element name="Serie" type="tsSerieRps" minOccurs="1" maxOccurs="1"/>
307
+ <xsd:element name="Tipo" type="tsTipoRps" minOccurs="1" maxOccurs="1"/>
308
+ </xsd:sequence>
309
+ </xsd:complexType>
310
+ <xsd:complexType name="tcIdentificacaoPrestador">
311
+ <xsd:sequence>
312
+ <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
313
+ <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
314
+ </xsd:sequence>
315
+ </xsd:complexType>
316
+ <xsd:complexType name="tcIdentificacaoTomador">
317
+ <xsd:sequence>
318
+ <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="0" maxOccurs="1"/>
319
+ <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
320
+ </xsd:sequence>
321
+ </xsd:complexType>
322
+ <xsd:complexType name="tcDadosTomador">
323
+ <xsd:sequence>
324
+ <xsd:element name="IdentificacaoTomador" type="tcIdentificacaoTomador" minOccurs="0" maxOccurs="1"/>
325
+ <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="0" maxOccurs="1"/>
326
+ <xsd:element name="Endereco" type="tcEndereco" minOccurs="0" maxOccurs="1"/>
327
+ <xsd:element name="Contato" type="tcContato" minOccurs="0" maxOccurs="1"/>
328
+ </xsd:sequence>
329
+ </xsd:complexType>
330
+ <xsd:complexType name="tcIdentificacaoIntermediarioServico">
331
+ <xsd:sequence>
332
+ <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="1" maxOccurs="1"/>
333
+ <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="1" maxOccurs="1"/>
334
+ <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
335
+ </xsd:sequence>
336
+ </xsd:complexType>
337
+ <xsd:complexType name="tcValores">
338
+ <xsd:sequence>
339
+ <xsd:element name="ValorServicos" type="tsValor" minOccurs="1" maxOccurs="1"/>
340
+ <xsd:element name="ValorDeducoes" type="tsValor" minOccurs="0" maxOccurs="1"/>
341
+ <xsd:element name="ValorPis" type="tsValor" minOccurs="0" maxOccurs="1"/>
342
+ <xsd:element name="ValorCofins" type="tsValor" minOccurs="0" maxOccurs="1"/>
343
+ <xsd:element name="ValorInss" type="tsValor" minOccurs="0" maxOccurs="1"/>
344
+ <xsd:element name="ValorIr" type="tsValor" minOccurs="0" maxOccurs="1"/>
345
+ <xsd:element name="ValorCsll" type="tsValor" minOccurs="0" maxOccurs="1"/>
346
+ <xsd:element name="IssRetido" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
347
+ <xsd:element name="ValorIss" type="tsValor" minOccurs="0" maxOccurs="1"/>
348
+ <xsd:element name="ValorIssRetido" type="tsValor" minOccurs="0" maxOccurs="1"/>
349
+ <xsd:element name="OutrasRetencoes" type="tsValor" minOccurs="0" maxOccurs="1"/>
350
+ <xsd:element name="BaseCalculo" type="tsValor" minOccurs="0" maxOccurs="1"/>
351
+ <xsd:element name="Aliquota" type="tsAliquota" minOccurs="0" maxOccurs="1"/>
352
+ <xsd:element name="ValorLiquidoNfse" type="tsValor" minOccurs="0" maxOccurs="1"/>
353
+ <xsd:element name="DescontoIncondicionado" type="tsValor" minOccurs="0" maxOccurs="1"/>
354
+ <xsd:element name="DescontoCondicionado" type="tsValor" minOccurs="0" maxOccurs="1"/>
355
+ </xsd:sequence>
356
+ </xsd:complexType>
357
+ <xsd:complexType name="tcDadosServico">
358
+ <xsd:sequence>
359
+ <xsd:element name="Valores" type="tcValores" minOccurs="1" maxOccurs="1"/>
360
+ <xsd:element name="ItemListaServico" type="tsItemListaServico" minOccurs="1" maxOccurs="1"/>
361
+ <xsd:element name="CodigoCnae" type="tsCodigoCnae" minOccurs="0" maxOccurs="1"/>
362
+ <xsd:element name="CodigoTributacaoMunicipio" type="tsCodigoTributacao" minOccurs="0" maxOccurs="1"/>
363
+ <xsd:element name="Discriminacao" type="tsDiscriminacao" minOccurs="1" maxOccurs="1"/>
364
+ <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"/>
365
+ </xsd:sequence>
366
+ </xsd:complexType>
367
+ <xsd:complexType name="tcDadosConstrucaoCivil">
368
+ <xsd:sequence>
369
+ <xsd:element name="CodigoObra" type="tsCodigoObra" minOccurs="1" maxOccurs="1"/>
370
+ <xsd:element name="Art" type="tsArt" minOccurs="1" maxOccurs="1"/>
371
+ </xsd:sequence>
372
+ </xsd:complexType>
373
+ <xsd:complexType name="tcDadosPrestador">
374
+ <xsd:sequence>
375
+ <xsd:element name="IdentificacaoPrestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
376
+ <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="1" maxOccurs="1"/>
377
+ <xsd:element name="NomeFantasia" type="tsNomeFantasia" minOccurs="0" maxOccurs="1"/>
378
+ <xsd:element name="Endereco" type="tcEndereco" minOccurs="1" maxOccurs="1"/>
379
+ <xsd:element name="Contato" type="tcContato" minOccurs="0" maxOccurs="1"/>
380
+ </xsd:sequence>
381
+ </xsd:complexType>
382
+ <xsd:complexType name="tcInfRps">
383
+ <xsd:sequence>
384
+ <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps" minOccurs="1" maxOccurs="1"/>
385
+ <xsd:element name="DataEmissao" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
386
+ <xsd:element name="NaturezaOperacao" type="tsNaturezaOperacao" minOccurs="1" maxOccurs="1"/>
387
+ <xsd:element name="RegimeEspecialTributacao" type="tsRegimeEspecialTributacao" minOccurs="0" maxOccurs="1"/>
388
+ <xsd:element name="OptanteSimplesNacional" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
389
+ <xsd:element name="IncentivadorCultural" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
390
+ <xsd:element name="Status" type="tsStatusRps" minOccurs="1" maxOccurs="1"/>
391
+ <xsd:element name="RpsSubstituido" type="tcIdentificacaoRps" minOccurs="0" maxOccurs="1"/>
392
+ <xsd:element name="Servico" type="tcDadosServico" minOccurs="1" maxOccurs="1"/>
393
+ <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
394
+ <xsd:element name="Tomador" type="tcDadosTomador" minOccurs="0" maxOccurs="1"/>
395
+ <xsd:element name="IntermediarioServico" type="tcIdentificacaoIntermediarioServico" minOccurs="0" maxOccurs="1"/>
396
+ <xsd:element name="ContrucaoCivil" type="tcDadosConstrucaoCivil" minOccurs="0" maxOccurs="1"/>
397
+ </xsd:sequence>
398
+ <!--
399
+ ALTERADO POR BELO HORIZONTE
400
+ MOTIVO: Compatibilizar com o estado, em que o nome do atributo é Id, com I maiúsculo.
401
+ -->
402
+ <xsd:attribute name="Id" type="tsIdTag"/>
403
+ </xsd:complexType>
404
+ <xsd:complexType name="tcRps">
405
+ <xsd:sequence>
406
+ <xsd:element name="InfRps" type="tcInfRps" minOccurs="1" maxOccurs="1"/>
407
+ <xsd:element ref="dsig:Signature" minOccurs="0" maxOccurs="1"/>
408
+ </xsd:sequence>
409
+ </xsd:complexType>
410
+ <xsd:complexType name="tcIdentificacaoNfse">
411
+ <xsd:sequence>
412
+ <xsd:element name="Numero" type="tsNumeroNfse" minOccurs="1" maxOccurs="1"/>
413
+ <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
414
+ <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
415
+ <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"/>
416
+ </xsd:sequence>
417
+ </xsd:complexType>
418
+ <xsd:complexType name="tcInfNfse">
419
+ <xsd:sequence>
420
+ <xsd:element name="Numero" type="tsNumeroNfse" minOccurs="1" maxOccurs="1"/>
421
+ <xsd:element name="CodigoVerificacao" type="tsCodigoVerificacao" minOccurs="1" maxOccurs="1"/>
422
+ <xsd:element name="DataEmissao" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
423
+ <xsd:element name="IdentificacaoRps" minOccurs="0" type="tcIdentificacaoRps" maxOccurs="1"/>
424
+ <xsd:element name="DataEmissaoRps" type="xsd:date" minOccurs="0" maxOccurs="1"/>
425
+ <xsd:element name="NaturezaOperacao" type="tsNaturezaOperacao" minOccurs="1" maxOccurs="1"/>
426
+ <xsd:element name="RegimeEspecialTributacao" type="tsRegimeEspecialTributacao" minOccurs="0" maxOccurs="1"/>
427
+ <xsd:element name="OptanteSimplesNacional" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
428
+ <xsd:element name="IncentivadorCultural" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
429
+ <xsd:element name="Competencia" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
430
+ <xsd:element name="NfseSubstituida" type="tsNumeroNfse" minOccurs="0" maxOccurs="1"/>
431
+ <xsd:element name="OutrasInformacoes" type="tsOutrasInformacoes" minOccurs="0" maxOccurs="1"/>
432
+ <xsd:element name="Servico" type="tcDadosServico" minOccurs="1" maxOccurs="1"/>
433
+ <xsd:element name="ValorCredito" type="tsValor" minOccurs="0" maxOccurs="1"/>
434
+ <xsd:element name="PrestadorServico" type="tcDadosPrestador" minOccurs="1" maxOccurs="1"/>
435
+ <xsd:element name="TomadorServico" type="tcDadosTomador" minOccurs="0" maxOccurs="1"/>
436
+ <xsd:element name="IntermediarioServico" type="tcIdentificacaoIntermediarioServico" minOccurs="0" maxOccurs="1"/>
437
+ <xsd:element name="OrgaoGerador" type="tcIdentificacaoOrgaoGerador" minOccurs="1" maxOccurs="1"/>
438
+ <xsd:element name="ContrucaoCivil" type="tcDadosConstrucaoCivil" minOccurs="0" maxOccurs="1"/>
439
+ </xsd:sequence>
440
+ <!--
441
+ ALTERADO POR BELO HORIZONTE
442
+ MOTIVO: Compatibilizar com o estado, em que o nome do atributo é Id, com I maiúsculo.
443
+ -->
444
+ <xsd:attribute name="Id" type="tsIdTag"/>
445
+ </xsd:complexType>
446
+ <xsd:complexType name="tcNfse">
447
+ <xsd:sequence>
448
+ <xsd:element name="InfNfse" type="tcInfNfse" minOccurs="1" maxOccurs="1"/>
449
+ <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="2"/>
450
+ </xsd:sequence>
451
+ <xsd:attribute name="versao" type="tsVersao" use="required" />
452
+ </xsd:complexType>
453
+
454
+ <xsd:complexType name="tcInfPedidoCancelamento">
455
+ <xsd:sequence>
456
+ <xsd:element name="IdentificacaoNfse" type="tcIdentificacaoNfse" minOccurs="1" maxOccurs="1"/>
457
+ <xsd:element name="CodigoCancelamento" type="tsCodigoCancelamentoNfse" minOccurs="1" maxOccurs="1"/>
458
+ </xsd:sequence>
459
+ <!--
460
+ ALTERADO POR BELO HORIZONTE
461
+ MOTIVO: Compatibilizar com o estado, em que o nome do atributo é Id, com I maiúsculo.
462
+ -->
463
+ <xsd:attribute name="Id" type="tsIdTag"/>
464
+ </xsd:complexType>
465
+ <xsd:complexType name="tcPedidoCancelamento">
466
+ <xsd:sequence>
467
+ <xsd:element name="InfPedidoCancelamento" type="tcInfPedidoCancelamento" minOccurs="1" maxOccurs="1"/>
468
+ <xsd:element ref="dsig:Signature" minOccurs="0" maxOccurs="1"/>
469
+ </xsd:sequence>
470
+ </xsd:complexType>
471
+ <xsd:complexType name="tcConfirmacaoCancelamento">
472
+ <xsd:sequence>
473
+ <xsd:element name="Pedido" type="tcPedidoCancelamento" minOccurs="1" maxOccurs="1"/>
474
+ <xsd:element name="DataHoraCancelamento" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
475
+ </xsd:sequence>
476
+ <!--
477
+ ALTERADO POR BELO HORIZONTE
478
+ MOTIVO: Compatibilizar com o estado, em que o nome do atributo é Id, com I maiúsculo.
479
+ -->
480
+ <xsd:attribute name="Id" type="tsIdTag"/>
481
+ </xsd:complexType>
482
+
483
+ <!--
484
+ ADICIONADO POR BELO HORIZONTE
485
+ MOTIVO: Evitar a redefinição de elementos já existentes e prover uma melhor estruturação para o retorno do cancelamento.
486
+ Melhor explicado no tipo de retorno do cancelamento.
487
+ -->
488
+ <xsd:element name="RetCancelamento">
489
+ <xsd:complexType>
490
+ <xsd:sequence>
491
+ <xsd:element name="NfseCancelamento" type="tcCancelamentoNfse" minOccurs="1" maxOccurs="unbounded"/>
492
+ </xsd:sequence>
493
+ </xsd:complexType>
494
+ </xsd:element>
495
+ <!-- FIM ALTERAÇÃO BELO HORIZONTE -->
496
+
497
+ <xsd:complexType name="tcCancelamentoNfse">
498
+ <xsd:sequence>
499
+ <xsd:element name="Confirmacao" type="tcConfirmacaoCancelamento" minOccurs="1" maxOccurs="1"/>
500
+ <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"/>
501
+ </xsd:sequence>
502
+ <xsd:attribute name="versao" type="tsVersao" use="required" />
503
+ </xsd:complexType>
504
+
505
+ <xsd:complexType name="tcInfSubstituicaoNfse">
506
+ <xsd:sequence>
507
+ <xsd:element name="NfseSubstituidora" type="tsNumeroNfse" minOccurs="1" maxOccurs="1"/>
508
+ </xsd:sequence>
509
+ <!--
510
+ ALTERADO POR BELO HORIZONTE
511
+ MOTIVO: Compatibilizar com o estado, em que o nome do atributo é Id, com I maiúsculo.
512
+ -->
513
+ <xsd:attribute name="Id" type="tsIdTag"/>
514
+ </xsd:complexType>
515
+ <xsd:complexType name="tcSubstituicaoNfse">
516
+ <xsd:sequence>
517
+ <xsd:element name="SubstituicaoNfse" type="tcInfSubstituicaoNfse" minOccurs="1" maxOccurs="1"/>
518
+ <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="2"/>
519
+ </xsd:sequence>
520
+ <xsd:attribute name="versao" type="tsVersao" use="required" />
521
+ </xsd:complexType>
522
+ <xsd:complexType name="tcCompNfse">
523
+ <xsd:sequence>
524
+ <xsd:element name="Nfse" type="tcNfse" minOccurs="1" maxOccurs="1"/>
525
+ <xsd:element name="NfseCancelamento" type="tcCancelamentoNfse" minOccurs="0" maxOccurs="1"/>
526
+ <xsd:element name="NfseSubstituicao" type="tcSubstituicaoNfse" minOccurs="0" maxOccurs="1"/>
527
+ </xsd:sequence>
528
+ </xsd:complexType>
529
+ <xsd:element name="CompNfse" type="tcCompNfse"/>
530
+ <xsd:element name="ListaMensagemRetorno">
531
+ <xsd:complexType>
532
+ <xsd:sequence>
533
+ <xsd:element name="MensagemRetorno" type="tcMensagemRetorno" minOccurs="1" maxOccurs="unbounded"/>
534
+ </xsd:sequence>
535
+ </xsd:complexType>
536
+ </xsd:element>
537
+ <!--
538
+ ALTERADO POR BELO HORIZONTE
539
+ -->
540
+ <xsd:element name="ListaMensagemRetornoLote">
541
+ <xsd:complexType>
542
+ <xsd:sequence>
543
+ <xsd:element name="MensagemRetorno" type="tcMensagemRetornoLote" minOccurs="1" maxOccurs="unbounded"/>
544
+ </xsd:sequence>
545
+ </xsd:complexType>
546
+ </xsd:element>
547
+ <!--
548
+ FIM ALTERAÇÃO BELO HORIZONTE
549
+ -->
550
+ <xsd:complexType name="tcMensagemRetorno">
551
+ <xsd:sequence>
552
+ <xsd:element name="Codigo" type="tsCodigoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
553
+ <xsd:element name="Mensagem" type="tsDescricaoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
554
+ <xsd:element name="Correcao" type="tsDescricaoMensagemAlerta" minOccurs="0"/>
555
+ </xsd:sequence>
556
+ </xsd:complexType>
557
+ <xsd:complexType name="tcMensagemRetornoLote">
558
+ <xsd:sequence>
559
+ <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps" minOccurs="1" maxOccurs="1"/>
560
+ <xsd:element name="Codigo" type="tsCodigoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
561
+ <xsd:element name="Mensagem" type="tsDescricaoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
562
+ </xsd:sequence>
563
+ </xsd:complexType>
564
+ <xsd:complexType name="tcLoteRps">
565
+ <xsd:sequence>
566
+ <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="1" maxOccurs="1"/>
567
+ <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
568
+ <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="1" maxOccurs="1"/>
569
+ <xsd:element name="QuantidadeRps" type="tsQuantidadeRps" minOccurs="1" maxOccurs="1"/>
570
+ <xsd:element name="ListaRps" minOccurs="1" maxOccurs="1">
571
+ <xsd:complexType>
572
+ <xsd:sequence>
573
+ <xsd:element name="Rps" maxOccurs="unbounded" type="tcRps" minOccurs="1">
574
+ </xsd:element>
575
+ </xsd:sequence>
576
+ </xsd:complexType>
577
+ </xsd:element>
578
+ </xsd:sequence>
579
+ <!--
580
+ ALTERADO POR BELO HORIZONTE
581
+ MOTIVO: Compatibilizar com o estado, em que o nome do atributo é Id, com I maiúsculo.
582
+ -->
583
+ <xsd:attribute name="Id" type="tsIdTag"/>
584
+ <xsd:attribute name="versao" type="tsVersao" use="required" />
585
+ </xsd:complexType>
586
+
587
+ <xsd:element name="EnviarLoteRpsResposta">
588
+ <xsd:complexType>
589
+ <xsd:choice>
590
+ <xsd:sequence>
591
+ <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="1" maxOccurs="1"/>
592
+ <xsd:element name="DataRecebimento" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
593
+ <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"/>
594
+ </xsd:sequence>
595
+ <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
596
+ </xsd:choice>
597
+ </xsd:complexType>
598
+ </xsd:element>
599
+
600
+ <xsd:element name="EnviarLoteRpsEnvio">
601
+ <xsd:complexType>
602
+ <xsd:sequence>
603
+ <xsd:element name="LoteRps" type="tcLoteRps"/>
604
+ <xsd:element ref="dsig:Signature" minOccurs="0" maxOccurs="1"/>
605
+ </xsd:sequence>
606
+ </xsd:complexType>
607
+ </xsd:element>
608
+
609
+ <!--
610
+ ALTERADO POR BELO HORIZONTE
611
+ ALTERAÇÃO: minOccurs do elemento NumeroLote alterado para zero, ao invés de 1.
612
+ MOTIVO: Há a situação de lote não recebido, se for enviado um protocolo inexistente no parâmetro da consulta. Logo, não haverá
613
+ número de lote a ser retornado nessa situação.
614
+ -->
615
+ <xsd:element name="ConsultarSituacaoLoteRpsResposta">
616
+ <xsd:complexType>
617
+ <xsd:choice>
618
+ <xsd:sequence>
619
+ <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="0" maxOccurs="1"/>
620
+ <xsd:element name="Situacao" type="tsSituacaoLoteRps" minOccurs="1" maxOccurs="1"/>
621
+ </xsd:sequence>
622
+ <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
623
+ </xsd:choice>
624
+ </xsd:complexType>
625
+ </xsd:element>
626
+ <!-- FIM ALTERAÇÃO BELO HORIZONTE -->
627
+
628
+ <xsd:element name="ConsultarSituacaoLoteRpsEnvio">
629
+ <xsd:complexType>
630
+ <xsd:sequence>
631
+ <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
632
+ <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"/>
633
+ </xsd:sequence>
634
+ </xsd:complexType>
635
+ </xsd:element>
636
+
637
+ <!--
638
+ ALTERADO POR BELO HORIZONTE
639
+ ALTERAÇÃO: Utilizar o apontamento ref para a NFS-e retornada.
640
+ MOTIVO: O elemento CompNfse já está definido, não há a necessidade de redefiní-lo nesse tipo de elemento, apenas utilizar uma
641
+ referência a ele.
642
+ -->
643
+ <xsd:element name="ConsultarNfseRpsResposta">
644
+ <xsd:complexType>
645
+ <xsd:choice>
646
+ <xsd:element ref="CompNfse" minOccurs="1" maxOccurs="1"/>
647
+ <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
648
+ </xsd:choice>
649
+ </xsd:complexType>
650
+ </xsd:element>
651
+ <!-- FIM ALTERAÇÃO BELO HORIZONTE -->
652
+
653
+ <xsd:element name="ConsultarNfseRpsEnvio">
654
+ <xsd:complexType>
655
+ <xsd:sequence>
656
+ <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps" minOccurs="1" maxOccurs="1"/>
657
+ <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
658
+ </xsd:sequence>
659
+ </xsd:complexType>
660
+ </xsd:element>
661
+
662
+ <!--
663
+ ALTERADO POR BELO HORIZONTE
664
+ ALTERAÇÃO: Utilizar o apontamento ref para as NFS-e retornadas no elemento ListaNfse.
665
+ MOTIVO: O elemento CompNfse já está definido, não há a necessidade de redefiní-lo nesse tipo de elemento, apenas utilizar uma
666
+ referência a ele.
667
+ ALTERAÇÃO: minOccurs de CompNfse dentro de ListaNfse alterado para 1, ao invés de zero.
668
+ MOTIVO: Se a filtragem não retornar registros, é mais sugestivo retornar uma mensagem no elemento ListaMensagemRetorno alertando
669
+ o usuário sobre o fato, além de outros possíveis erros nessa lista como vínculo indevido de inscrição municipal e CNPJ informado
670
+ nos parâmetros da pesquisa.
671
+ -->
672
+ <xsd:element name="ConsultarNfseResposta">
673
+ <xsd:complexType>
674
+ <xsd:choice>
675
+ <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
676
+ <xsd:complexType>
677
+ <xsd:sequence>
678
+ <xsd:element ref="CompNfse" minOccurs="1"/>
679
+ </xsd:sequence>
680
+ </xsd:complexType>
681
+ </xsd:element>
682
+ <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
683
+ </xsd:choice>
684
+ </xsd:complexType>
685
+ </xsd:element>
686
+ <!-- FIM ALTERAÇÃO BELO HORIZONTE -->
687
+
688
+ <xsd:element name="ConsultarNfseEnvio">
689
+ <xsd:complexType>
690
+ <xsd:sequence>
691
+ <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
692
+ <xsd:element name="NumeroNfse" type="tsNumeroNfse" minOccurs="0" maxOccurs="1"/>
693
+ <xsd:element name="PeriodoEmissao" minOccurs="0" maxOccurs="1">
694
+ <xsd:complexType>
695
+ <xsd:sequence>
696
+ <xsd:element name="DataInicial" type="xsd:date" minOccurs="1" maxOccurs="1"/>
697
+ <xsd:element name="DataFinal" type="xsd:date" minOccurs="1" maxOccurs="1"/>
698
+ </xsd:sequence>
699
+ </xsd:complexType>
700
+ </xsd:element>
701
+ <xsd:element name="Tomador" type="tcIdentificacaoTomador" minOccurs="0" maxOccurs="1"/>
702
+ <xsd:element name="IntermediarioServico" type="tcIdentificacaoIntermediarioServico" minOccurs="0" maxOccurs="1"/>
703
+ </xsd:sequence>
704
+ </xsd:complexType>
705
+ </xsd:element>
706
+
707
+ <!--
708
+ ALTERADO POR BELO HORIZONTE
709
+ ALTERAÇÃO: Utilizar o apontamento ref para as NFS-e retornadas no elemento ListaNfse.
710
+ MOTIVO: O elemento CompNfse já está definido, não há a necessidade de redefiní-lo nesse tipo de elemento, apenas utilizar uma
711
+ referência a ele.
712
+ ALTERAÇÃO: Adição na estrutura de choice do retorno da lista de mensagem de retorno do lote.
713
+ MOTIVO: Nessa resposta temos 3 possibilidade de retorno, ou a lista de NFS-e, ou a lista de erros comuns informandos erros nos
714
+ parâmetros enviados pelo serviço ou a lista de erros dos RPS's em questão, que é a lista já especificada mas que não estava
715
+ sendo apontada desse tipo de dado. Esse erro é especial pois contém a referência ao RPS em que houve aquele erro.
716
+ -->
717
+ <xsd:element name="ConsultarLoteRpsResposta">
718
+ <xsd:complexType>
719
+ <xsd:choice>
720
+ <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
721
+ <xsd:complexType>
722
+ <xsd:sequence>
723
+ <xsd:element ref="CompNfse" maxOccurs="unbounded" minOccurs="1"/>
724
+ </xsd:sequence>
725
+ </xsd:complexType>
726
+ </xsd:element>
727
+ <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
728
+ <xsd:element ref="ListaMensagemRetornoLote" minOccurs="1" maxOccurs="1"/>
729
+ </xsd:choice>
730
+ </xsd:complexType>
731
+ </xsd:element>
732
+ <!-- FIM ALTERAÇÃO BELO HORIZONTE -->
733
+
734
+ <xsd:element name="ConsultarLoteRpsEnvio">
735
+ <xsd:complexType>
736
+ <xsd:sequence>
737
+ <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
738
+ <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"/>
739
+ </xsd:sequence>
740
+ </xsd:complexType>
741
+ </xsd:element>
742
+
743
+ <!--
744
+ ALTERADO POR BELO HORIZONTE
745
+ ALTERAÇÃO: Referencia para RetCancelamento ao invés de Cancelamento diretamente.
746
+ MOTIVO: Evitar a redefinição de elementos já existentes e prover uma melhor estruturação para o retorno do cancelamento.
747
+ A NFS-e quando formada em CompNfse tem o nome do tipo de dado NfseCancelamento, para melhorar essa compatibilidade de nomes
748
+ e a estruturação dessa resposta do serviço de cancelamento.
749
+ -->
750
+ <xsd:element name="CancelarNfseResposta">
751
+ <xsd:complexType>
752
+ <xsd:choice>
753
+ <xsd:element ref="RetCancelamento" minOccurs="1" maxOccurs="1"/>
754
+ <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
755
+ </xsd:choice>
756
+ </xsd:complexType>
757
+ </xsd:element>
758
+ <!-- FIM ALTERAÇÃO BELO HORIZONTE -->
759
+
760
+ <xsd:element name="CancelarNfseEnvio">
761
+ <xsd:complexType>
762
+ <xsd:sequence>
763
+ <xsd:element name="Pedido" type="tcPedidoCancelamento"/>
764
+ </xsd:sequence>
765
+ </xsd:complexType>
766
+ </xsd:element>
767
+
768
+ <!--
769
+ Cabeçalho de dados
770
+ -->
771
+ <xsd:element name="cabecalho">
772
+ <xsd:complexType>
773
+ <xsd:sequence>
774
+ <xsd:element name="versaoDados" type="tsVersao" minOccurs="1" maxOccurs="1"/>
775
+ </xsd:sequence>
776
+ <xsd:attribute name="versao" type="tsVersao" use="required" />
777
+ </xsd:element>
778
+
779
+ </xsd:schema>