Hi
I'm using an xml filter on data containing deep tags that sometimes contains arrays and sometimes dont.
The xml filter generates the json with arrays, even when there is only one value.
for example:
"Header" => [
[0] {
"AccountInfo" => [
[0] {
"CurrencyID" => [
[0] "00"
],
"AccountID" => [
[0] "11111"
]
}
]
}
I'm looking for a generic way to convert all arrays with one value to a standard value.
for example
"Header" =>
{
"AccountInfo" =>
{
"CurrencyID" => "00",
"AccountID" => "11111"
}
}
I'll be happy if you could help me or guide me .
Note
- it should support deep nesting.
- Arrays with more then one value shouldn't change.
thanks