1、xml的内容
<user>
<name>fannie</name>
<age>18</age>
<address>
<city name="shanghai"/>
<area name="changningqu" code="100010"/>
</address>
<address>
<city name="anhui"/>
<area name="anqing" code="201491"/>
</address>
</user>
2、转换为Json的书写格式
var s={
"user":
{
"name":"fannie",
"age":"18",
"address":[
{
"city":{"name":"shanghai"},
"area":{"name":"changningqu","code":"100010"}
}, {
"city":{"name":"anhui"},
"area":{"name":"anqing","code":"201491"}
}
]
}