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

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/.

主站蜘蛛池模板: 石首市| 田阳县| 监利县| 牟定县| 许昌市| 台安县| 潜山县| 黄梅县| 修文县| 西贡区| 邢台县| 安福县| 江口县| 岚皋县| 盐边县| 万山特区| 健康| 福鼎市| 古浪县| 潮安县| 武胜县| 双桥区| 永仁县| 海林市| 桃园市| 石景山区| 曲麻莱县| 高密市| 德钦县| 武隆县| 宁津县| 云梦县| 卓尼县| 绥阳县| 隆回县| 南宁市| 罗山县| 景德镇市| 洪泽县| 陵川县| 图片|