Convert JSON to XML and back. Repeated tags become an array. The other side updates as you type.
1
1
XML is a markup language. A document has one root element, and elements may contain text or other elements. The W3C published XML 1.0 as a Recommendation on 10 February 1998.
This page maps a JSON object to child elements. An array becomes repeated elements of the same name. Coming back, one element is a value and several siblings with the same name are an array. Leaf text that looks like a number, true, false, or null is parsed as that JSON type.
{"name":"Ada","tags":["a","b"]}<root> <name>Ada</name> <tags>a</tags> <tags>b</tags> </root>
<root> <name>Ada</name> <tags>a</tags> <tags>b</tags> </root>
{
"name": "Ada",
"tags": ["a", "b"]
}Expect the string "1" to come back as a string
Leaf text 1 is read as the number 1
A one-element array is written as a single tag, and a single tag is read as a value, not an array. tags: ["a"] comes back as tags: "a".
Attributes are dropped, and a warning says so. A key that is not an XML name is rewritten. Names that start with xml are refused for the root.
The five predefined entities are amp, lt, gt, quot, and apos. Numeric character references are accepted. Other entities are rejected, and a document type declaration is rejected, so no external entity is fetched.
The share link stores the source side, its text, and the root name. The other side is computed again. Anyone who has the link can read that text.
XML 1.0 became a W3C Recommendation on 10 February 1998, edited by Tim Bray, Jean Paoli, and C. M. Sperberg-McQueen. The fifth edition is dated 26 November 2008.
JSON was specified by Douglas Crockford in RFC 4627 in July 2006. It has no attributes and no repeated keys, which is why this mapping has to choose a rule for arrays.