RevealTheme logo

XMLからJSONへの変換ツール

XMLドキュメントをJSONに変換します。属性は接頭辞@の付いたキーになり、繰り返されるタグは配列になります。

このツールの使い方

  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.

XMLからJSONへの変換ツールとは何ですか?

XMLからJSONへの変換は、いくつかの点で情報の損失を伴います。XMLは名前空間、処理命令、CDATAセクションをサポートしていますが、これらにはJSONで直接対応するものがありません。この変換ツールは、ネストした要素、属性(接頭辞@付き)、テキストコンテンツ(#text)といったケースの90%に対応します。複雑なXMLには、専用のライブラリが必要になる場合があります。

よくある活用例

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

よくある質問

接頭辞@とは何ですか?
属性は、同じ名前の子要素と区別するために@属性名として格納されます。

関連ツール