1
我正在将XML文档转换为JSON。json.net没有将xml节点转换为数组
我有一个节点可能是多个节点。
Json.Net documentation说强制将节点序列化成数组我应该添加json:array=true
属性。
在我的根节点我添加了添加json
命名空间:
writer.WriteAttributeString("xmlns", "json", null, "http://james.newtonking.com/json");
那么元素我需要一个数组我添加json:array=true
属性:
writer.WriteAttributeString("Array", "http://james.newtonking.com/json", "true");
的XML看起来预计:
<result xmlns:json="http://james.newtonking.com/json">
<object json:Array="true">
但是JSON看起来像这样:
"result": {
"@xmlns:json": "http://james.newtonking.com/json",
"object": {
"@json:Array": "true",
我在做什么错?