RevealTheme logo

Conversor de XML para JSON

Converta documentos XML para JSON. Os atributos viram chaves com prefixo @; as tags repetidas viram arrays.

Como usar esta ferramenta

  1. 1

    Paste or type your XML into the input box.

  2. 2

    Read the converted JSON in the output panel below, which updates as you type.

  3. 3

    If the XML is malformed, fix the error shown in red and the output will reappear.

  4. 4

    Select the JSON from the output panel to copy it into your project.

O que é o Conversor de XML para JSON?

Passar de XML para JSON implica perda de informação em alguns aspectos: o XML aceita namespaces, instruções de processamento e seções CDATA que não têm equivalentes diretos no JSON. Este conversor lida com 90% dos casos: elementos aninhados, atributos (com prefixo @) e conteúdo de texto (#text). Para XML complexo, pode ser necessária uma biblioteca dedicada.

Casos de uso comuns

  • Inspect a SOAP or legacy XML API response as JSON before wiring it into a JavaScript front end.

  • Convert an RSS or Atom feed snippet into JSON to prototype a parser quickly.

  • Turn a config file or build manifest written in XML into JSON to eyeball its structure.

  • Pull values out of an XML sitemap or data export when a JSON shape is easier to traverse.

  • Teach or learn how attributes, repeated tags, and text nodes map between the two formats.

  • Sanity-check that a small XML payload is well-formed, since malformed input shows a parser error.

Perguntas frequentes

O que é o prefixo @?
Os atributos são armazenados como @nomedoatributo para distingui-los dos elementos filhos com o mesmo nome.

Ferramentas relacionadas