node-xml2js icon indicating copy to clipboard operation
node-xml2js copied to clipboard

Creating a xml

Open joweste opened this issue 4 years ago • 1 comments

Hi, I am a newbie with this package. I neeed a help, please .

  1. How can I create a xml similar to the next?
  2. I need to validate the xml against a xsd ("http://www.ans.gov.br/padroes/tiss/schemas/tissV3_02_02.xsd").

How can I do that?

Is there some package or function to do it? If not, is there some third package to take care it?

<?xml version="1.0" encoding="ISO-8859-1"?>
<ans:mensagemTISS xmlns:ans="http://www.ans.gov.br/padroes/tiss/schemas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ans.gov.br/padroes/tiss/schemas http://www.ans.gov.br/padroes/tiss/schemas/tissV3_02_02.xsd">
  <ans:cabecalho>
    <ans:identificacaoTransacao>
      <ans:tipoTransacao>ENVIO_LOTE_GUIAS</ans:tipoTransacao>
      <ans:sequencialTransacao>8378</ans:sequencialTransacao>
    </ans:identificacaoTransacao>
    <ans:versaoPadrao>3.02.02</ans:versaoPadrao>
  </ans:cabecalho>
  <ans:epilogo>
    <ans:hash>6af733693b2cbaca574d6d0478f7586b</ans:hash>
  </ans:epilogo>
</ans:mensagemTISS>

joweste avatar Jul 11 '20 14:07 joweste

To validate against an xsd I found this library to do the job: https://github.com/marudor/libxmljs2

JasonDictos avatar Jul 14 '20 04:07 JasonDictos