官术网_书友最值得收藏!

JSON versus XML

One of the primary reasons why XML was created in the nineties was that it allowed open data sharing by providing an interchangeable data serialization format. It was able to handle native data types and also other formats such as images, audio, documents and so on.

While it is possible to attach any file format to an XML message, JSON on the other hand, only supports simple data structures stored as arrays. Both formats have their advantages, but data transfers will be easier and faster if the data serialization resembles the structure of the data it represents. JSON makes it very easy to import the data into languages such as JavaScript, Ruby, Python, and many others.

XML is the ideal format for transferring documents as it can be used to define the structure or format of the data along with the actual data. When returning XML, it should be without the namespaces present.

JSON is best used for data sharing as it is only suitable for transferring the data component.

Note

More information about JSON can be found at http://www.json.org/.

主站蜘蛛池模板: 报价| 鄢陵县| 银川市| 涿州市| 山东| 新巴尔虎左旗| 乐昌市| 东安县| 三亚市| 垣曲县| 曲水县| 谢通门县| 乌海市| 莒南县| 文安县| 钦州市| 卢氏县| 西昌市| 昌黎县| 信宜市| 宝山区| 苏尼特左旗| 渑池县| 车致| 广昌县| 闻喜县| 大化| 江门市| 房产| 兰西县| 永平县| 陈巴尔虎旗| 岑溪市| 丰宁| 花垣县| 阜康市| 济宁市| 姚安县| 五家渠市| 黑河市| 安吉县|