测试网站的链接:https://c.runoob.com/front-end/53?from=%E6%96%87%E7%AB%A0%E9%A1%B5%E5%86%85%E9%93%BE%E6%8E%A5
JSON:
{
"sites": {
"id": "1",
"name": "菜鸟教程",
"url": "www.runoob.com",
"lang": {"en": "false", "zn": "true"},
"address": [
{"city": "beijing", "province": "null"},
{"city": "chengdu", "province": "sichuan"}
]
}
}
对应XML:
<?xml version="1.0" encoding="UTF-8" ?>
<sites>
<id>1</id>
<name>菜鸟教程</name>
<url>www.runoob.com</url>
<lang>
<en>false</en>
<zn>true</zn>
</lang>
<address>
<city>beijing</city>
<province>null</province>
</address>
<address>
<city>chengdu</city>
<province>sichuan</province>
</address>
</sites>
格式:
{ // 无意义
// 1) 普通属性
"属性名" : "属性值",
// 2) 对象
"对象名" : { 对象的属性、对象或数组 },
// 3) 数组
"数组名" : [
{ 数组的属性、对象或数组 },
{ 数组的属性、对象或数组 }
]
} // 无意义