1.什么是Json?

JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式。 易于人阅读和编写。同时也易于机器解析和生成。 它基于JavaScript Programming LanguageStandard ECMA-262 3rd Edition - December 1999的一个子集。 JSON采用完全独立于语言的文本格式,但是也使用了类似于C语言家族的习惯(包括C, C++, C#, Java, JavaScript, Perl, Python等)。 这些特性使JSON成为理想的数据交换语言。

JSON建构于两种结构:

  • “名称/值”对的集合(A collection of name/value pairs)。不同的语言中,它被理解为对象(object),纪录(record),结构(struct),字典(dictionary),哈希表(hash table),有键列表(keyed list),或者关联数组 (associative array)。
  • 值的有序列表(An ordered list of values)。在大部分语言中,它被理解为数组(array)。

这些都是常见的数据结构。事实上大部分现代计算机语言都以某种形式支持它们。这使得一种数据格式在同样基于这些结构的编程语言之间交换成为可能。

JSON具有以下这些形式:

对象是一个无序的“‘名称/值’对”集合。一个对象以“{”(左括号)开始,“}”(右括号)结束。每个“名称”后跟一个“:”(冒号);“‘名称/值’ 对”之间使用“,”(逗号)分隔。

数组是值(value)的有序集合。一个数组以“[”(左中括号)开始,“]”(右中括号)结束。值之间使用“,”(逗号)分隔。

值(value)可以是双引号括起来的字符串(string)、数值(number)、truefalse、 null、对象(object)或者数组(array)。这些结构可以嵌套。

字符串(string)是由双引号包围的任意数量Unicode字符的集合,使用反斜线转义。一个字符(character)即一个单独的字符串(character string)。

字符串(string)与C或者Java的字符串非常相似。

数值(number)也与C或者Java的数值非常相似。除去未曾使用的八进制与十六进制格式。除去一些编码细节。

2.xml介绍

1. Introduction

Extensible Markup Language, abbreviated XML, describes a class of data objects called XML documents and partially describes the behavior of computer programs which process them. XML is an application profile or restricted form of SGML, the Standard Generalized Markup Language [ISO 8879]. By construction, XML documents are conforming SGML documents. 

XML documents are made up of storage units called entities, which contain either parsed or unparsed data. Parsed data is made up of characters, some of which form character data, and some of which form markup. Markup encodes a description of the document's storage layout and logical structure. XML provides a mechanism to impose constraints on the storage layout and logical structure.

[Definition:] A software module called an XML processor is used to read XML documents and provide access to their content and structure. [Definition:] It is assumed that an XML processor is doing its work on behalf of another module, called the application. This specification describes the required behavior of an XML processor in terms of how it must read XML data and the information it must provide to the application.

1.1 Origin and Goals

XML was developed by an XML Working Group (originally known as the SGML Editorial Review Board) formed under the auspices of the World Wide Web Consortium (W3C) in 1996. It was chaired by Jon Bosak of Sun Microsystems with the active participation of an XML Special Interest Group (previously known as the SGML Working Group) also organized by the W3C. The membership of the XML Working Group is given in an appendix. Dan Connolly served as the WG's contact with the W3C. 

The design goals for XML are:

  1. XML shall be straightforwardly usable over the Internet.
  2. XML shall support a wide variety of applications.
  3. XML shall be compatible with SGML.
  4. It shall be easy to write programs which process XML documents.
  5. The number of optional features in XML is to be kept to the absolute minimum, ideally zero.
  6. XML documents should be human-legible and reasonably clear.
  7. The XML design should be prepared quickly.
  8. The design of XML shall be formal and concise.
  9. XML documents shall be easy to create.
  10. Terseness in XML markup is of minimal importance.

本博文内容摘自:

https://www.xml.com/axml/axml.html

http://json.org/json-zh.html

最新文章

  1. Linux 升级修改libc gcc 文件名称,导致执行命令失效问题解决
  2. XML编程知识点总结
  3. css013 构建基于浮动的布局
  4. 【Gerrit】Gerrit与Jenkins/Hudson CI服务器搭建
  5. javaSwing文本框组件
  6. Atitit. 高级软件工程师and 普通的区别 高级编程的门槛总结
  7. java.el.PropertyNotFoundException解决方法
  8. hdu 2421 Deciphering Password(约数个数问题)
  9. 为什么new的普通数组用delete 和 delete[]都能正确释放
  10. memcached 与 redis 的区别和具体应用场景
  11. Mysql SQL执行错误:#1136
  12. for里面是采用setInterval遍历二维数组,for循环到最后一个数的时候,才执行setInterval的问题解决
  13. springBoot 自动配置原理--自己新建一个 starter
  14. 【linux】硬盘原理简介和分区
  15. Spring学习日志之纯Java配置的MVC框架搭建
  16. MD5+salt 工具类
  17. 【PowerDesigner】【8】把Comment复制到name中和把name复制到Comment
  18. ShopEx customSchema 定制能够依据客户的需求对站点进行对应功能的加入改动或者删除
  19. Java 数据库访问层
  20. UITextView 的使用

热门文章

  1. docker启动容器报错: could not synchronise with container process: not a directory
  2. Guitar Pro里的编谱方式怎么用?
  3. SOAPdenovo组装软件使用记录
  4. Microsoft Visual Studio已停止工作
  5. html5的websocket
  6. spark的二次排序
  7. C# 获取往控件中拖进的文件或文件夹的信息
  8. net基础运算符
  9. SSH免密码登录教程
  10. vue组件局部与全局注册的区别