I have this XML <e> <a>text</a> <a>text</a> </e>
when I use XMLSerializer to do the conversion to JSON, i got {"e": [ "text", "text" ]}
the array name 'a' is missing...
but if I have <e id='2'> <a>text</a> <a>text</a> </e> I got {"e": { "@id": "2", "a": [ "text", "text" ] }}
"a" is back.. Is there is a way to always have my array name regardless if the element has an attribute or not?
Log in to post a comment.
I have this XML
<e> <a>text</a> <a>text</a> </e>
when I use XMLSerializer to do the conversion to JSON, i got
{"e": [
"text",
"text"
]}
the array name 'a' is missing...
but if I have <e id='2'> <a>text</a> <a>text</a> </e>
I got
{"e": {
"@id": "2",
"a": [
"text",
"text"
]
}}
"a" is back.. Is there is a way to always have my array name regardless if the element has an attribute or not?