Convert JSONC to XML

Turn JSONC files into XML. Objects become elements inside one root element and every value becomes text, with characters a tag name cannot hold turned into underscores.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop JSONC files on the dialor turn it to pick what to do

JSONC data written as one XML file.Objects become elements, and every value becomes text.

  1. What you get

    One XML file. Your data sits inside a single root element, and each object becomes an element with its keys as child elements.

    Every value is written as text. Characters that a tag name cannot hold are turned into underscores in the key names.

  2. Attributes and text

    Keys that start with @ become attributes. Lists and objects under such a key are written as JSON text inside the attribute. A key named #text becomes the element's own text.

  3. What changes or is left behind

    A list repeats its element, once for each item. An empty list therefore disappears, and a list of lists is flattened into one run of repeated elements.

    Comments and trailing commas are dropped. The XML holds only the data.

    To go the other way, use XML to JSONC.

JSONC and XML.What each format is.

The formats

From · JSONC

JSON with Comments

JSON that allows comments, as in editor and TypeScript configuration files.

Extensions
.jsonc
MIME type
text/x-jsonc
Kind
Text and data
To · XML

XML

XML documents and data.

Extensions
.xml
MIME type
application/xml
Kind
Text and data

In your code.The same JSONC to XML conversion through the API, for your app or your agent.

terminal
$ cv convert report.jsonc report.xml
$ cv convert report.jsonc report.xml

Questions.What people ask about JSONC to XML.

01OF 04

They are dropped. The XML file holds only the data.

A list repeats its element, once for each item. An empty list leaves nothing behind, and a list of lists is flattened.

No. Every value becomes text in the XML.

Those characters are turned into underscores in the element name.

More conversions.Other ways in and out of JSONC and XML.