I am struggling with creating a generic function that will convert a JSON object to XML
Note: the number of columns in the headers and body may vary. Additionally, I am not interested in values in the footer
I Have the following JSON structure:
{
"header": [ "Room", "Maximum Capacity" ],
"footer": null,
"body": [
[ "Game Room", "0" ],
[ "gymnasium", "" ],
[ "Library", "200" ]
]
}
I would like to format:
<root>
<row>
<Room>Game Room</Room>
<MaximumCapacity>0</MaximumCapacity>
</row>
<row>
<Room>gymnasium</Room>
<MaximumCapacity></MaximumCapacity>
</row>
<row>
<Room>Library</Room>
<MaximumCapacity>200</MaximumCapacity>
</row>
</root>