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. Rob G Can you prefix the attributes with @ and put them at the top of the object? It says in the docs: Attributes are prefixed with an @ and should be at the start of the object. looks like: "@length": "3", for a definition of an attribute called 'length' Alternatively you could