Convert JSON to XML with root-name and attribute options.
The JSON to XML converter turns a JSON document into indented XML under a root element you name. Arrays become repeated elements, keys beginning with @_ become attributes, and special characters are escaped. It is a quick way to feed JSON data to a system that expects XML.
JSON and XML describe similar trees but have no official one-to-one mapping, so every converter makes choices. XML needs a single root element, so this tool wraps your data in the element named in Root element. Each JSON key becomes a child element and its value becomes the element's text or its nested children. Because XML has no array type, an array is written as the same element repeated once per item. Attributes are an XML concept without a JSON equivalent, so by convention a key that starts with @_ is written as an attribute of the parent, and a key named #text holds the text of an element that also has attributes. Element names must be valid XML names, so characters such as spaces are replaced with underscores.
An array under a key becomes that element repeated once per item. For example {"tags":["a","b"]} gives two <tags> elements.
Prefix the key with @_ . A key "@_id":"7" on an object becomes id="7" on its element. Use the key #text for the text content of an element that also has attributes.
XML allows only one root element, but a top-level array is written as the root element repeated for each item. Wrap the array in an object to get a single root.
No. XML text has no types, so values are written as their text, such as 5 or true.
No. The conversion happens in the page and the input is not sent anywhere.