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/.
- Java程序設計實戰教程
- Rake Task Management Essentials
- Learning RabbitMQ
- 精通軟件性能測試與LoadRunner實戰(第2版)
- MATLAB應用與實驗教程
- Bootstrap Essentials
- Modern JavaScript Applications
- SQL Server 2016數據庫應用與開發
- Learning OpenStack Networking(Neutron)(Second Edition)
- BeagleBone Black Cookbook
- UI設計全書(全彩)
- 從零開始學Unity游戲開發:場景+角色+腳本+交互+體驗+效果+發布
- Kotlin語言實例精解
- Thymeleaf 3完全手冊
- Analytics for the Internet of Things(IoT)