JSON ↔ XML
Convert XML and JSON with explicit mapping rules.
How to use
JSON objects map to XML elements, arrays to repeated elements, @_-prefixed keys to attributes and #text to text. XML values remain strings. Mixed content, DTDs and null values are rejected because this mapping cannot preserve them.
Example
{"person":{"name":"Ada"}} ↔ <person><name>Ada</name></person>.
Good to know
Where is my data processed?
Your browser performs the operation. Input stays in page memory. Markdown draft saving is available when you explicitly enable it on this device.
How are XML attributes and text represented?
Use JSON keys prefixed with @_ for attributes and #text for text content. Arrays map to repeated elements, and XML values remain strings when converted to JSON.
Which content triggers a conversion error?
Mixed XML content, DTDs and JSON null values produce errors because the supported mapping cannot preserve their meaning.