RevealTheme logo

Convertitore da XML a JSON

Converte i documenti XML in JSON. Gli attributi diventano chiavi con prefisso @; i tag ripetuti diventano array.

Come usare questo strumento

  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.

Che cos'è il convertitore da XML a JSON?

Passare da XML a JSON comporta una perdita di informazioni sotto alcuni aspetti: XML supporta spazi dei nomi, istruzioni di elaborazione e sezioni CDATA che non hanno equivalenti diretti in JSON. Questo convertitore gestisce il 90% dei casi: elementi annidati, attributi (con prefisso @) e contenuto di testo (#text). Per l'XML complesso può essere necessaria una libreria dedicata.

Casi d'uso comuni

  • 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.

Domande frequenti

Che cos'è il prefisso @?
Gli attributi vengono memorizzati come @nomeattributo per distinguerli dagli elementi figli con lo stesso nome.

Strumenti correlati