【发布时间】:2015-12-22 02:50:22
【问题描述】:
我想按照以下示例将 xml 转换为 json: 示例 XML:
<Details>
<Records>
<name id='123'>xyz</name>
<age>25</age>
<gender type='male' />
</Records>
</Details>
预期的 JSON 输出:
{
"Details": {
"Records": {
"name": {
"@id": "123",
"#text": "xyz"
},
"age": "25",
"gender": {
"@type": "male"
}
}
}
}
请帮帮我。
【问题讨论】:
-
你试过什么?您想使用什么工具/库?你的问题现在太不具体了——有很多方法可以做到这一点。
-
请按照以下网址,[Convert XMl to JsonObject using Javascript,Jquery][1] [1]: stackoverflow.com/questions/20679135/…
-
没有。我需要从头开始构建它。我没有代码。需要知道这样做的方法。
-
请点击此链接 [Convert XMl to JsonObject using Javascript,Jquery][1] [1]: stackoverflow.com/questions/20679135/…