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/.
- Mastering Visual Studio 2017
- 深入理解Bootstrap
- Reporting with Visual Studio and Crystal Reports
- GraphQL學(xué)習(xí)指南
- INSTANT FreeMarker Starter
- Java編程指南:基礎(chǔ)知識、類庫應(yīng)用及案例設(shè)計(jì)
- Python網(wǎng)絡(luò)爬蟲從入門到實(shí)踐(第2版)
- 匯編語言程序設(shè)計(jì)(第2版)
- Python計(jì)算機(jī)視覺編程
- 網(wǎng)頁設(shè)計(jì)與制作教程(HTML+CSS+JavaScript)(第2版)
- Visual Foxpro 9.0數(shù)據(jù)庫程序設(shè)計(jì)教程
- 一塊面包板玩轉(zhuǎn)Arduino編程
- ASP.NET求職寶典
- WCF全面解析
- 第五空間戰(zhàn)略:大國間的網(wǎng)絡(luò)博弈