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

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

主站蜘蛛池模板: 九寨沟县| 台东市| 东平县| 德庆县| 澎湖县| 尼木县| 霍山县| 横山县| 木里| 乐至县| 石棉县| 准格尔旗| 黑河市| 达拉特旗| 普兰县| 二连浩特市| 平度市| 玛纳斯县| 茂名市| 汽车| 新巴尔虎左旗| 三门县| 庄浪县| 农安县| 宁陕县| 滨海县| 巴林右旗| 平邑县| 常宁市| 溧阳市| 德钦县| 中江县| 玉树县| 新泰市| 荃湾区| 邹平县| 保靖县| 乌拉特中旗| 宜兴市| 平舆县| 云安县|