1
使用Newtonsoft的.Net庫將JSON轉換爲XML,有沒有辦法將特定的JSON元素轉換爲XML屬性?如何將JSON屬性轉換爲XML作爲xml元素的屬性
例如,採取以下JSON:
{
"array": {
"item": [
1,
2,
3
],
"length": 3
}
}
並將其轉換爲:
<array length="3">
<item>1</item>
<item>2</item>
<item>3</item>
</array>
感謝。
你如何用@包含的標籤來裝飾類? –
這可能有所幫助:http://stackoverflow.com/questions/4686817/serialize-net-object-to-json-controlled-using-xml-attributes –