JSON: the fat-free alternative to XML

Source: Internet
Author: User

JSON: the fat-free alternative to XML

JSON: rich and free XML alternatives

(I don't know if this title is translated, right)

 

The Extensible Markup Language (XML) is a text format derived from the Standard Generic Markup Language (SGML. Compared with SGML, XML is very simple. Hypertext Markup Language (HTML), through comparison, or even simpler. Even so, good HTML reference books are 1 inch thick. This is because the format and structure of organizational files are complex services.

 

Most of the hot spots around XML are centered on a new role, a data serialization format that can be exchanged with it.
XML provides two major advantages as a data representation language:

 

1. It is text-based.

2. The platform is independent.

 

Compared with other data exchange formats, these advantages allow independent applications to reach a higher level. In fact, XML is already a W3C standard.

 

Unfortunately, XML is not suitable for data exchange, just like a wrench is not suitable for driving fingers. It carries a lot of luggage and does not match the data model in most programming languages. When most programmers see XML for the first time, it's shocking how ugly and inefficient they are. Facts have proved that the first response is correct. There is another text symbol, which has all the advantages of XML, but is more suitable for data exchange. This symbol is a JavaScript Object symbol (JSON ).

 

The XML-based most sensible (see xmlsuck.org for example) suggests that XML as a data exchange format has big problems, but these shortcomings are compensated by the benefits of interoperability and openness.

 

JSON provides the same benefits as the open commitment, but does not have the same disadvantages.

 

Let's compare the attributes that the XML community regards as important in XML and JSON.

 

From http://www.simonstl.com/articles/whyxml.htm

 

Simple

XML is simpler than SGML, but JSON is much simpler than XML. JSON has a simpler syntax for data structures and maps that are more directly used in modern programming languages.

 

Scalability

JSON is not extensible because it is not required. JSON is a document markup language, so it is unnecessary to define new labels or attributes to represent data.

 

Interoperability

JSON is the potential for XML interoperability.

 

Open

JSON is at least as open as XML, probably because it is not at the center of the Enterprise/political standardization struggle.

 

From http://www.karto.ethz.ch/neumann/caving/cavexml/why_xml.html

 

In general, the following are some advantages of XML.

 

XML is readable.

JSON is easier to read than XML. It is also easy to write. It is also easier to read and write for machines.

 

XML can be used as an exchange format to allow users to transmit data between similar applications.

JSON can also be used.

 

XML provides a data structure, so it has rich information

JSON is the same.

 

XML is easy to process, because the data structure is simple and standard.

JSON processing is easier, because its structure is simpler.

 

There is a reusable and widely used software that provides programmers with XML processing so that they do not have to re-invent the code.

JSON is a simple symbol, and specialized processing software is much less. No additional software is required for programming languages built with JavaScript and Python JSON symbols. In other languages, only a small amount of JSON-specific code is necessary. For example, JSON packaged into Java provides three simple classes that are provided free of charge from json.org.

 

XML separates the data structure from the data.

XML must be translated into a data structure of the document structure. This ing can be complex. The JSON structure is based on arrays and records, which are components of the JSON structure. XML-based structure elements (nesting), attributes (not allowed), original text content, entities, DTD, and other meta-structures.

 

A common exchange format

JSON is a better data exchange format. XML is a better file exchange format. Appropriate tools should be used to adapt to the appropriate work.

 

Many opinions on one data

JSON does not provide any display function because it is not a file markup language.

 

From http://www.softwareag.com/xml/about/xml_why.htm

 

 

Self-describing data

XML and JSON are the same at this point.

 

Is a complete integration of traditional databases and formats

(XML reports are sometimes exaggerated.) XML files can contain any data type that you can imagine-from classic data, such as text and numbers, or audio and other multimedia objects, common formats such as Java applets or ActiveX components.

 

JSON does not have the <[CDATA []> function, so it is not suitable as a carrier for sound, image, or other large binary data. JSON data is optimized. In addition, dangerous security issues can be introduced if executable programs are provided in the data exchange system.

 

Internationalization

Both XML and JSON use Unicode.

 

Open and scalable

XML is an open structure that allows you to add art elements from other countries as needed. This means that you can always make your system accept the vocabulary of a specific industry.

 

These words can be automatically converted to JSON, making data from XML to JSON very simple.

 

From

Http://www.xmlspy.com/manual/whyxml.htm

 

XML is easy to read by humans and machines.

JSON is easy to read by humans and machines.

 

XML is object-oriented

In fact, XML is document-oriented. JSON is data-oriented. JSON can be easily mapped to an object-oriented system.

 

XML is widely used in the computer industry

JSON is well known at the beginning. It is simple. The convenience of converting XML into JSON makes JSON easy to accept.

 

 

 

The first time I translated the article, it was quite time-consuming, difficult, and fun. I hope you can pick up the mistakes.

Original English address

Http://www.json.org/xml

 

 

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.