XML is converted to invalid JSON when array has attributes
<root>
<n id="10" x="abc" />
<n id="11" x="bcd" />
</root>
Xml.toJson creates invalid JSON:
{"root": {"n": ["n":"","x":"abc","id":"10","n":"","x":"bcd","id":"11"}]}}
should be:
{"root": {"n": [{"n":"","x":"abc","id":"10"}, {"n":"","x":"bcd","id":"11"} ]}}
Leave a comment