Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
actually I am struggeling to figure out how to convert following JSON-structure (in an file) to an equivalent XML-structure to save it also in a file.
My structure in the JSON-file:
{
"stations":[
{
"id":"5475",
"name":"Stationname_1",
"poles":[
{
"location":
{
"lat":36.4767361,
"long":12.4574503
},
"id":"54751"
}
]
},
{
"id":"1952",
"name":"Stationname_2",
"poles":[
{
"location":{
"lat":36.3712358,
"long":12.7045717
},
"id":"19521"
},
{
"location":{
"lat":36.3720289,
"long":12.7013738
},
"id":"19522"
}
]
}
]
}
How you can see the "stations"-attribute is an array including various amount of stations-objects. Every station-object is containing a "poles"-attribute which is also an array containing various amount of objects.
I created structures for the input and the output and also a mapping. The "stations" and "poles" attributes I configured as "sequence" group type.
Created mapping:
Configuration structure (dump):
My problem is that I am using tHMap the first time and have no idea how to configure it (
in "Talend Data Services Platform 7.3.1"), especially to handle the arrays, to get an solution. Also I doesn't know the configuration of tFileInputJSON is alright.
Configuration tFileInputJSON:
Can you also explain me why "id" wasn't connected? It is very confusing.
Connection map:
Sorry for my many questions! I would be very grateful for your help!
Friendly greetings
unTalended
@not specified not specified , you need to read your json file using tFileInput and pass to the tHmap,if you have loop on the particular field it will pass a array when you have multiple values.