XML CSV JSON Equivalences - sgml/signature GitHub Wiki
Original:
<Parent Name="name2">
<Child Name="ChildName1"></Child>
<Child Name="ChildName2"></Child>
</Parent>
Minimized XML:
<names>
<name1>
<childName1/>
<childName2/>
</name1>
<name2>
<childName1/>
<childName2/>
</name2>
</names>
And the CSV to this:
name1 ChildName1
name1 ChildName2
name2 ChildName1
name2 ChildName2
with a JSON serialization like this:
{"names":
[
{
"name1":
[
{
"childName1":""
},
{
"childName2":""
}
]
},
{
"name2":
[
{
"childName1":""
},
{
"childName2":""
}
]
}
]
}
In a row-oriented fashion, the XML could be:
<names>
<name1 name="ChildName1|ChildName2">
<name2 name="ChildName1|ChildName2">
</names>
And the corresponding CSV:
name1 ChildName1|ChildName2
name2 ChildName1|ChildName2
And the corresponding JSON:
{"names": [{"name1":"ChildName1|ChildName2"},{"name2":"ChildName1|ChildName2"}]}