XML to JSON guides

2 min read

In short
  • Every guide here describes the xml-json-v1 mapping the converter actually applies — not a generic tutorial.
  • The namespaces guide walks a small document from its xmlns declaration to the JSON keys it produces.
On this page
  1. XML namespaces: prefixes, xmlns, and JSON keys
  2. The mapping behind every example

These guides explain what the XML to JSON converter does with the documents you paste into it. They work from the same source of truth as the tool: the xml-json-v1 mapping documented on the converter page under mapping examples, so what you read here is what the tool outputs.

XML namespaces: prefixes, xmlns, and JSON keys

A worked walkthrough of namespace declarations: what the namespace name, the prefix, the local name and the expanded name are; how a default namespace applies to unprefixed element names but not directly to unprefixed attributes; and why qualified names like a:itemare kept verbatim as JSON keys instead of being merged. Each small example in the guide is converted with the mapping, so you can predict your own payload before converting it. Read XML namespaces: prefixes, xmlns, and JSON keys.

The mapping behind every example

Character data stays a JSON string, attribute keys are prefixed with@, repeated siblings with one qualified name become one ordered array, and significant text mixed with child elements is rejected rather than flattened. The full rule table with worked examples is on the converter page at the xml-json-v1 mapping; what a run rejects and how the worker, cancelling and the 20-second limit behave is described at how a conversion run works.

Ready to try it: the converter loads a sample document and runs entirely in this browser tab.