RevealTheme logo

Convertisseur XML vers JSON

Convertissez vos documents XML en JSON. Les attributs deviennent des clés préfixées par @ ; les balises répétées deviennent des tableaux.

Comment utiliser cet outil

  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.

Qu'est-ce que le convertisseur XML vers JSON ?

Le passage du XML au JSON entraîne certaines pertes : le XML prend en charge les espaces de noms, les instructions de traitement et les sections CDATA qui n'ont pas d'équivalents directs en JSON. Ce convertisseur gère 90 % des cas : éléments imbriqués, attributs (préfixés par @) et contenu textuel (#text). Pour du XML complexe, une bibliothèque dédiée peut s'avérer nécessaire.

Cas d'usage courants

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

Questions fréquentes

Qu'est-ce que le préfixe @ ?
Les attributs sont stockés sous la forme @nomattribut afin de les distinguer des éléments enfants portant le même nom.

Outils connexes