是否有任何java库将JSON数据转换为具有属性支持的XML,反之亦然。
输入JSON
{
"test": "123",
"PersonInfoShipTo": {
"@AddressID": "",
"@ZipCode": "fdsafsa"
},
"OrderLineItems": [
{
"@OrderLineItemId": "OrderLineItemId"
},
{
"@OrderLineItemId": "OrderLineItemId"
}
]
}
输出XML
<?xml version="1.0" encoding="UTF-8"?>
<Order>
<OrderLineItems>
<OrderLineItem OrderLineItemId="OrderLineItemId" />
<OrderLineItem OrderLineItemId="OrderLineItemId" />
</OrderLineItems>
<PersonInfoShipTo AddressID="" ZipCode="fdsafsa" />
<test>123</test>
</Order>