我正在使用 net.sf.json 将通用 JSON 解析为 XML。(我没有在转换中使用 POJO Obj)
我正在转换的 Json:
{
"root": {
"accountId": "1000",
"Items": [
{
"cost": 0.1,
"debit": 0.1
},
{
"cost": 0.2,
"debit": 0.2
}
]
}
}
在处理我收到的向量时:
<root>
<entry>
<accountId>1000</accountId>
<Items>
<e>
<cost>0.1</cost>
<debit>0.1</debit>
</e>
<e>
<cost>0.2</cost>
<debit>0.2</debit>
</e>
</Items>
</entry>
</root>
当我的观点正确时应该是:
<root>
<entry>
<accountId>1000</accountId>
<Items>
<cost>0.1</cost>
<debit>0.1</debit>
</Items>
<Items>
<cost>0.2</cost>
<debit>0.2</debit>
</Items>
</entry>
</root>
有没有人使用过这个库并且可以帮助我?
任何提示都会有所帮助!
提前致谢