About XML to JSON
XML to JSON is handy when an older system, a SOAP service, an RSS feed or a sitemap hands you XML and your code would rather work with JSON. Paste the XML or open a file and the JSON appears alongside, wrapped in an object named after the root element. When the records should end up in a spreadsheet instead, XML to Excel turns them into rows.
Nothing in the structure gets lost. Attributes become keys starting with @, so <book id="b1"> gives "@id": "b1". Elements that repeat, like several <book> entries, become an array, and the text of an element that also has attributes goes under #text. Values are kept as strings, exactly as written. If the XML is broken, you see the parser's message instead of a half-finished result.
How to use XML to JSON
- 1Paste or open XML
Paste into Input or open an .xml file; Example shows a small catalog to try.
- 2Check the result
The XML to JSON output updates as you type, and syntax errors are shown under Result.
- 3Copy or save
Copy the JSON or save it as a .json file.
Why use Cubfile for this
- Attributes as @keys
Attribute values sit next to child elements, clearly marked with @ so nothing clashes.
- Repeated elements as arrays
Several siblings with the same name become a JSON array, keeping their order.
- Runs in your browser
The XML isn't uploaded, and the tool doesn't count toward daily tasks.
- Clear error messages
A missing closing tag or stray character is reported instead of silently producing bad JSON.