Convert XML Document to JSON Document

This section provides a quick introduction on options of converting XML documents to JSON documents: using ready-to-run tools; calling conversion libraries; and implementing your own converter.



If you have some data saved as an XML formatted document, which needs to be shared with a friend who only accepts JSON formatted documents, you have to find a way to convert your XML document to a JSON document.

You have 3 options to get the job done:

1. Find a online or offline tool to convert your XML document into a JSON 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 XML-to-JSON tools are:

2. Find an XML-to-JSON conversion library of your favorite programming language. Then write a short computer code to call the library to convert your XML document into a JSON document. Usually, conversion libraries offers more options than ready-to-run tools to control the output. Examples of XML-to-JSON 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 XML-to-JSON converter.



 

Table of Contents

 About This Book

 Introduction of XML (eXtensible Markup Language)

 XML File Syntax

 XML File Browsers

XML-JSON Document Conversion

 What Is JSON (JavaScript Object Notation)

Convert XML Document to JSON Document

 XML-to-JSON Conversion Rules

 XML-to-JSON Conversion Tool at onlinexmltools.com

 XML-to-JSON Conversion Library for Java

 XML-to-JSON Conversion Module for Python

 Convert JSON Document to XML Document

 JSON-to-XML Conversion Rules

 JSON-to-XML Conversion Tool at onlinexmltools.com

 JSON-to-XML Conversion Library for Java

 JSON-to-XML Conversion Module for Python

 DOM (Document Object Model) Programming Interface

 SAX (Simple API for XML) Programming Interface

 DTD (Document Type Definition) Introduction

 Syntaxes of DTD Statements

 Validating an XML Document against the Specified DTD Document Type

 XSD (XML Schema Definition) Introduction

 Syntaxes of XSD Statements

 Validating XML Documents Against Specified XML Schemas

 XSL (Extensible Stylesheet Language) Introduction

 XSLT (XSL Transformations) Introduction

 Java Implementation of XSLT

 XPath (XML Path) Language

 XSLT Elements as Programming Statements

 Control and Generate XML Element in the Result

 PHP Extensions for XML Manipulation

 XML Notepad - XML Editor

 XML Tools Plugin for Notepad++

 XML Plugin Packages for Atom Editor

 XML 1.1 Changes and Parsing Examples

 Outdated Tutorials

 References

 Full Version in PDF/EPUB