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

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

主站蜘蛛池模板: 拜泉县| 昭平县| 肥西县| 府谷县| 博乐市| 赤峰市| 万州区| 伊宁市| 鄂温| 苏尼特左旗| 青岛市| 岳池县| 永登县| 永靖县| 禄劝| 六安市| 光山县| 濮阳市| 洛阳市| 搜索| 阿拉善右旗| 克东县| 汾西县| 灵石县| 博湖县| 吉隆县| 白玉县| 梅州市| 合肥市| 广南县| 通化市| 凯里市| 常熟市| 梁平县| 合川市| 手机| 蓝山县| 馆陶县| 五华县| 金塔县| 成武县|