please let me know how we can convert below json request into multiple xml elements. Is it good to convert json into xml and then split xml based on Person tag and do processing or we can directly use json and convert it to output format input request:
{
"Persons":{
"Person": [
{
"LineID": 123456,
"Attributes": { "PersonMap": "Emp1,Emp2" },
"Department": 10
},
{
"LineID": 123456,
"Attributes": { "PersonMap": "Emp3,Emp4" },
"Department": 20
}
]
}
}
output expected:
<Records>
<EmpRec>
<id>Emp1</id>
<dept>10</dept>
</EmpRec>
<EmpRec>
<id>Emp2</id>
<dept>10</dept>
</EmpRec>
<EmpRec>
<id>Emp3</id>
<dept>20</dept>
</EmpRec>
<EmpRec>
<id>Emp4</id>
<dept>20</dept>
</EmpRec>
</Records>
Thanks in advance...