Java Reference
In-Depth Information
[{"name":"Amanda","score"=12.9},{"name":"Paolo","score"=14},{"name":"Zambo","score"=12.3}]
Value
A JSON value can be a string in double quotes, a boolean true or false, an ob-
ject , an array or null .
Why JSON?
The XML ( Extensible Markup Language ) was released after the SGML ( Stand-
ardised Generalised Markup Language , which was powerful and extensible but
complex) and the HTML ( HyperText Markup Language , a simple version of SGML
focused on data presentation) to overcome the shortcomings of both languages. Its
power, flexibility, and simplicity have favored its use in many applications for con-
figuration management, storage, data transfer, and so on. With the advent of AJAX
technologies, the use of XML was widespread in exchanges between browsers and
web servers. But, it presented some limitations: XML documents are heavy in nature
because of the duplication of information, loading, and handling of data can be com-
plex and processing XML documents sometimes is browser dependent.
To provide a solution to these problems, the JSON format was developed as an al-
ternative to XML. In fact, despite its portability and flexibility, JSON does not sup-
port namespaces, data access requires a knowledge of the document and until now,
there is no XSD or DTD to validate the document's structure.
A simple comparison between XML and JSON data presentation is shown in the fol-
lowing table:
XML data presentation
JSON data presentation
<student>
<id>854963</id>
<name>LouisPoyer</name>
<weight>78.6</weight>
{"student": {
"id":"854963",
"name":"LouisPoyer",
Search WWH ::




Custom Search