February 01, 2005

JSON: JavaScript Object Notation - Lightweight Data Inter-change Format

I have been given a link to JSON (JavaScript Object Notation), which is a project to create a data interchange format that is as language independent as XML but not as heavy in the bandwidth and parsing requirements. JSON is based on the JavaScript Programming Language and has bindings in the following programming languages:

  • C
  • C#
  • Java
  • JavaScript
  • Objective CAML
  • PHP
  • ML
  • Ruby

Here is a sample JSON message:

{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": [{
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML", "markup"]}]}}}

The same text expressed as XML:

<!DOCTYPE glossary PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
<glossary><title>example glossary</title>
<GlossDiv><title>S</title>
<GlossList>
<GlossEntry ID="SGML" SortAs="SGML">
<GlossTerm>Standard Generalized Markup Language</GlossTerm>
<Acronym>SGML</Acronym>
<Abbrev>ISO 8879:1986</Abbrev>
<GlossDef>
<para>A meta-markup language, used to create markup languages such as DocBook.</para>
<GlossSeeAlso OtherTerm="GML">
<GlossSeeAlso OtherTerm="XML">
</GlossDef>
<GlossSee OtherTerm="markup">
</GlossEntry>
...
</GlossList>
</GlossDiv>
</glossary>

Links
JSON Home Page

Posted by Egon Kuster at February 1, 2005 11:49 AM
Comments