Saturday, 17 August 2013

How to cause a JSON property to be converted to XML as an attribute of an xml-element

How to cause a JSON property to be converted to XML as an attribute of an
xml-element

Using Newtonsoft's .Net Library to convert JSON to XML, is there a way to
convert a specific JSON element to an XML attribute?
For example, taking the following JSON:
{
"array": {
"item": [
1,
2,
3
],
"length": 3
}
}
and converting it to:
<array length="3">
<item>1</item>
<item>2</item>
<item>3</item>
</array>
Thanks.

No comments:

Post a Comment