为什么JSON取代XML作为数据格式? [英] Why is JSON replacing XML as a data format?

查看:145
本文介绍了为什么JSON取代XML作为数据格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我第一次看到XML时,我认为它基本上是树的表示.然后我想:重要的不是树是它的 good 特别代表,而是每个人都同意的树.就像ASCII.并且一旦建立,就很难因网络效应而移位.新的替代方案必须要好得多(也许好10倍)才能取代它.当然,为了国际化,ASCII已(大部分)已被Unicode取代.

When I first saw XML, I thought it was basically a representation of trees. Then I thought: the important thing isn't that it's a particularly good representation of trees, but that it is one that everyone agrees on. Just like ASCII. And once established, it's hard to displace due to network effects. The new alternative would have to be much better (maybe 10 times better) to displace it. Of course, ASCII has been (mostly) replaced by Unicode, for internationalization.

根据 google趋势,XML的领先优势是x43,但随着JSON的增长,它正在下降.

According to google trends, XML has a x43 lead, but is declining - while JSON grows.

[编辑] JSON将如何以及为什么将XML替换为数据格式?

[edited] How and why will JSON replace XML as a data format?

  1. 执行哪些任务?
  2. 针对哪些程序员/行业?


注意: S表达式(来自Lisp)是树的另一种表示形式,但尚未获得主流采用.还有很多其他建议,例如YAML和协议缓冲区(用于二进制格式).


NOTES: S-expressions (from lisp) are another representation of trees, but which has not gained mainstream adoption. There are many, many other proposals, such as YAML and Protocol Buffers (for binary formats).

我可以看到JSON在与客户端AJAX(AJAJ?)的通信空间中占主导地位,并且这可能会暂时传递回其他系统中.

I can see JSON dominating the space of communicating with client-side AJAX (AJAJ?), and this possibly could back-spread into other systems transitively.

XML作为文档格式比JSON更好.我对XML作为数据格式感兴趣.

XML, being based on SGML, is better than JSON as a document format. I'm interested in XML as a data format.

XML具有JSON缺少的已建立的生态系统,尤其是定义格式(XML Schema)和转换格式(XSLT)的方法. XML还具有许多其他标准,尤其是针对Web服务的标准-但是可以说,它们的重要性和复杂性可以与XML相对,并且使人们希望有一个全新的起点(类似于"Web服务"是基于CORBA的全新起点).

XML has an established ecosystem that JSON lacks, especially ways of defining formats (XML Schema) and transforming them (XSLT). XML also has many other standards, esp for web services - but their weight and complexity can arguably count against XML, and make people want a fresh start (similar to "web services" beginning as a fresh start over CORBA).

[编辑的Mar2010 ]像NoSQL一样,JSON是 schemaless .

[edited Mar2010] Like NoSQL, JSON is schemaless.

推荐答案

我认为JSON已经在很大程度上取代了XML,用于与Web服务器进行客户端通信,但是这很可能是其优势所在.如您所述,XML提供了适合服务器到服务器交互的优点.

I think JSON has already largely replaced XML for client-side communications with a web server, but that will likely be the extent of its dominance. As you stated, XML provides advantages that are appropriate for server-to-server interactions.

这篇关于为什么JSON取代XML作为数据格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆