I am converting an XML document to JSON.
I have a node that could be multiple nodes.
The Json.Net documentation says to force the serialization of the node into an array I should add the json:array=true
attribute.
On my root node I add the add the json
namespace:
writer.WriteAttributeString("xmlns", "json", null, "http://james.newtonking.com/json");
then on the element I need to be an array I add the json:array=true
attribute:
writer.WriteAttributeString("Array", "http://james.newtonking.com/json", "true");
The XML looks as expected:
<result xmlns:json="http://james.newtonking.com/json">
<object json:Array="true">
but the JSON looks like this:
"result": {
"@xmlns:json": "http://james.newtonking.com/json",
"object": {
"@json:Array": "true",
What am I doing wrong?