I am looking for a conversion from JSON objects
to XML single row
for each object. Right now, I am able to convert to XML but, that is not I desired. Can somebody assist me? Also, I don't need some of the fields. Here are the JSON and preferred XML structure
.
Example of JSON
{
"paging": {
"limit": 100,
"total": 1394,
"next": "Mg=="
},
"data": [
{
"mmsi": 538006090,
"imo": 9700665,
"last_known_position": {
"timestamp": "2017-12-18T20:24:27+00:00",
"geometry": {
"type": "Point",
"coordinates": [
60.87363,
-13.02203
]
}
}
},
{
"mmsi": 527555481,
"imo": 970000,
"last_known_position": {
"timestamp": "2017-12-18T20:24:27+00:00",
"geometry": {
"type": "Point",
"coordinates": [
4.57883,
3.76899
]
}
}
}
]
}
The XML that I desired
<vessel>
<row mmsi="538006090" imo="9700665" lat="60.87363" lon="-13.02203"/>
<row mmsi="527555481" imo="970000" lat="4.57883" lon="3.76899"/>
</vessel>
Thank you