XML Tutorials - Herong's Tutorial Examples - 5.21, by Dr. Herong Yang
Convert JSON Document to XML Document
This section provides a quick introduction on options of converting JSON documents to XML documents: using ready-to-run tools; calling conversion libraries; and implementing your own converter.
If you have some data saved as a JSON formatted document, which needs to be shared with a friend who only accepts XML formatted documents, you have to find a way to convert your JSON document to an XML document.
You have 3 options to get the job done:
1. Find a online or offline tool to convert your JSON document into an XML document. But those ready-to-run tools follows their own conversion rules. You may not like what they generated for you and usually they don't have many options to change their behaviors. Examples of JSON-to-XML tools are:
2. Find a JSON-to-XML conversion library of your favorite programming language. Then write a short computer code to call the library to convert your JSON document to an XML document. Usually, conversion libraries offers more options than ready-to-run tools to control the output. Examples of JSON-to-XML libraries are:
3. Define your own conversion rules. Then implement those rules as a computer program in your favorite language. Here you have the full control of the output. See next tutorials on how to implement your own JSON-to-XML converter.
Table of Contents