Extensible Markup Language (XML) is a widely used language that was once the de facto standard for data interchange between applications. Since the advent of JSON, however, it has lost the advantage to the more simple nature of JSON. Nevertheless, XML is still used by applications and SOAP based web services
JavaScript Object Notation (JSON) pronounced as "Jason" is the de facto standard for data interchange on the web these days. It is a simple format that is easier to comprehend than XML. It also has less size than XML because of no closing tags. Interacting with JSON from JavaScript is extremely seamless. JSON format was first specified by Douglas Crockford in the early 2000s
This setting governs whether or not the output is indented. The indented output is easier for humans to comprehend. On the other hand, a non-indented output is compact & smaller in size (best for transmission). So, JSON is often minified which compacts & compresses the output by removing non-essential whitespace.
{
"name": "John Doe",
"age": 69
}
{"name":"John Doe","age":69}
If selected, arrays are flattened when possible.
<catalog>
<book>
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
</book>
<book>
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
</book>
</catalog>
[
{
"author": "Gambardella, Matthew",
"title": "XML Developer's Guide"
},
{
"author": "Ralls, Kim",
"title": "Midnight Rain"
}
]
{
"book": [
{
"author": "Gambardella, Matthew",
"title": "XML Developer's Guide"
},
{
"author": "Ralls, Kim",
"title": "Midnight Rain"
}
]
}
The prefix to use for properties corresponding to XML attributes. Set blank to use no prefix
<catalog>
<book id="1">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
</book>
<book id="2">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
</book>
</catalog>
{
"book": [
{
"@id": "1",
"author": "Gambardella, Matthew",
"title": "XML Developer's Guide"
},
{
"@id": "2",
"author": "Ralls, Kim",
"title": "Midnight Rain"
}
]
}
{
"book": [
{
"id": "1",
"author": "Gambardella, Matthew",
"title": "XML Developer's Guide"
},
{
"id": "2",
"author": "Ralls, Kim",
"title": "Midnight Rain"
}
]
}
The name of the property that holds the value of XML text nodes
<catalog>
<book>
<author>Gambardella, Matthew</author>
XML Developer's Guide
</book>
<book>
<author>Ralls, Kim</author>
Midnight Rain
</book>
</catalog>
{
"book": [
{
"author": "Gambardella, Matthew",
"#text": "XML Developer's Guide"
},
{
"author": "Ralls, Kim",
"#text": "Midnight Rain"
}
]
}
Comments 0