Data Interchange Format XML and JSON comparison in Jqueru

Source: Internet
Author: User

1. Introduction:

xml:extensible Markup Language, an HTML-like language that has no pre-defined tags, uses a DTD (document type definition) to organize the data using the file type definitions, uniform format, cross-platform and language, has long been recognized as a standard in the industry. Specifically, you can ask Google or Baidu. In contrast to this lightweight data interchange format of JSON, XML can be called Heavyweight.

The Json:javascript Object Notation is a lightweight data interchange format. Easy for people to read and write. It is also easy for machine parsing and generation. It is based on JavaScript programming Language, Standard ECMA-262 a subset of 3rd Edition-december 1999. JSON takes a completely language-independent text format, but also uses a similar idiom to the C language family (c, C + +, C #, Java, JavaScript, Perl, Python, etc.). These features make JSON an ideal data exchange language.

2. Contrast

1) XML is heavyweight in data Interchange format, and JSON is lightweight. This is reflected in the analysis.

XML currently designs three parsing methods: DOM, sax, and pull;

Sax does not require the entire document to be read into the parsed content can be processed, is a stepwise analysis of the method. The program can also terminate parsing at any time. In this way, a large document can be gradually and 1.1 points, so sax is suitable for large-scale parsing. At this point, JSON is not available at this time.

So, the difference between the light/weight of JSON and XML is that JSON only provides a holistic parsing scheme, which only works well when parsing less data, and XML provides a step-up solution to large-scale data that is well suited for processing large amounts of data.

2) Data Interchange Format comparison of data format encoding and parsing difficulty:

In encoding, although XML and JSON have their own coding tools, but JSON encoding is simpler than XML, even if the use of tools, you can write JSON code, but to write good XML code is a bit difficult; As with XML, JSON is text-based, And they all use Unicode encoding, and they are as readable as the data Interchange Format XML.

Subjectively, JSON is clearer and less redundant. The JSON Web site provides a strict description of the JSON syntax, just a short description. In general, XML is more appropriate for tagging documents, while JSON is more suitable for data interchange processing.

In the analytic, in the common Web application domain, the developer often has the nerve to parse the XML, whether the server side generates or processes the XML, or the client parses the XML, often causes the complex code, extremely low development efficiency.

The Data Interchange Format JSON provides greater simplicity and flexibility than XML or HTML fragments.

The JSON format is now promoted in the Web service as an initial stage, without the generality of XML. In Web Serivice applications, at least for now, XML still has an unshakable position.

Data Interchange Format XML and JSON comparison in Jqueru

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.