XML Tutorials - Herong's Tutorial Examples - v5.25, by Herong Yang
What Is JSON (JavaScript Object Notation)
This section provides a quick introduction of JSON (JavaScript Object Notation) - a text string format, similar to XML, that uses human-readable text to record data objects consisting of attribute–value pairs and array structures.
What Is JSON (JavaScript Object Notation)? JSON is a text string format that uses human-readable text to record data objects consisting of attribute–value pairs and array structures.
JSON was specified by Douglas Crockfor in in the early 2000s. It was originally derived from JavaScript, but now supported by many programming languages.
Here is a simple example of a JSON document:
{ "firstName": "John", "lastName": "Smith", "isAlive": true, "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021-3100" }, "phoneNumbers": [ { "type": "home", "number": "212 555-1234" }, { "type": "office", "number": "646 555-4567" }, { "type": "mobile", "number": "123 456-7890" } ], "children": [], "spouse": null }
As you can see, JSON is a structured text format similar to XML. Both of them can be used to encode complex and hierarchical data objects. But they do have several main differences:
1. JSON has less markup overhead than XML. Since XML requires to repeat the tag name to close each element, the XML presentation is about 5% longer than the JSON presentation of the same data object.
2. JSON has built-in data types. XML support text information only. But XML is extendable. You can add the standard XML Schema Instance to support a wide range of data types.
3. XML comes with additional technologies like XML Schema, XSLT, and XPath to validate, transform and extract the structured data object.
Table of Contents
Introduction of XML (eXtensible Markup Language)
►What Is JSON (JavaScript Object Notation)
Convert XML Document to JSON Document
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 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
Validating an XML Document against the Specified DTD Document Type
XSD (XML Schema Definition) Introduction
Validating XML Documents Against Specified XML Schemas
XSL (Extensible Stylesheet Language) Introduction
XSLT (XSL Transformations) Introduction
XSLT Elements as Programming Statements
Control and Generate XML Element in the Result
PHP Extensions for XML Manipulation
Processing XML with Python Scripts
XML Tools Plugin for Notepad++
XML Plugin Packages for Atom Editor