Online Interview Questions

Prepare interviews on Anything, AnyWhere

PHPSCOTS,Blogger, Developer Views: 1385

XML was originally developed as an independent data format, whereas JSON was developed specifically for use in the web with JavaScript and AJAX. That is why the format is exactly the same as a JavaScript literal object. JSON is a subset of the JavaScript code, just like the JavaScript code is a subset of the TypeScript. For example, one can’t contain expressions to determine values. How does that matter with the bra scenes?

JSON, or JavaScript Object Notation, is a file format in the open standard way that uses text that can be understood by humans to transmit data objects consisting of pairs of attributes and values as well as array data types.
Extensible Markup Language or the XML is a markup language that defines a set of rules for encoding documents in a format that is understood by humans as well as machines. It is also used to describe data, create information formats and electronically share structured data through the public Internet or corporate networks.

Following are some basic difference between JSON and XML

This format is quite the new kid on the block. That is a big reason behind why it is not supported as much by many developers.This has been around in the web world for quite some time now. This is a major reason why there is a lot of software, which has been developed for it.
It doesn’t use any end tags.It uses end tags.
JSON can only be parsed by a standard JavaScript function.XML just has to be parsed with an XML parser. This is also why it is much more difficult to parse.
It is mostly the first choice for object notation with a defined distinction between a record and a list.XML has no way of distinguishing between records, which are unordered items and lists which are ordered items identified by position.
In JSON, the low level syntax has the distinction between unordered records and ordered lists built into it. That is why it is very succinct and universal. In other words, JSON is more ‘self-describing’ by default. This is an important goal for both formats for less redundant repetition of names.Instead of differentiating between records and lists by syntax, XML makes use of elements versus attributes. By using extra user defined attributes, which only take string values, one can formalize the difference between lists

and records in XML.

JSON is a markup language. This means that its syntax has specific semantics built in. For instance, any code written between {} is an object, while any code written between [] is an array, etc.XML is a meta language. Its syntax is designed specifically such as to have no inherent semantics.
Read 20+ JSON Interview Questions AnswersFind Best Interview Questions on XML

It is so believed that as there was still a lot of hype about the Web in 1998; XML became popular due to its shallow resemblance to HTML. It is considered a strange design choice to try to apply to a hierarchical data syntax which is actually designed for convenient markup. Perhaps, the over application of XML in many aspects of the technology has diminished its real value. The wide usage of JavaScript for web development is thus a bonus to JSON.

Leave a Reply

Your email address will not be published. Required fields are marked *