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/.
- 大學計算機基礎實驗教程
- JavaScript+jQuery開發實戰
- Spring Cloud、Nginx高并發核心編程
- Windows Presentation Foundation Development Cookbook
- MySQL數據庫管理與開發實踐教程 (清華電腦學堂)
- Python數據可視化之Matplotlib與Pyecharts實戰
- Nexus規模化Scrum框架
- Getting Started with React Native
- Arduino計算機視覺編程
- Go語言開發實戰(慕課版)
- Spring 5 Design Patterns
- 新印象:解構UI界面設計
- 你好!Java
- Visual FoxPro程序設計習題及實驗指導
- Clojure編程樂趣