I hope I've set an appropriate "title" for this question. Let me share a mashed-up screenshot to show you what I mean:
I have JSON formatted output on the left (A) as a result of the conversion of XML data. I found that I needed to specifically include the "element" notation to have the structure of the file properly created (must have to do with the way that I'm dynamically looping and creating my XML). However, the actual JSON formatted output structure that I need is on the right (B). Somehow I need to drop the "element" notation... sort of "collapse" it I guess. (Again, I'm trying to avoid rewriting the code that creates the XML and instead, be able to convert my XML to the JSON that I need.)
OK. So it appears that I'm not allowed to post an image, so I'll try to mock something here up in text instead.
Here's what I'm getting:
JSON
productCategoriesList
element
{}
id=1
name=product type A
products
element
{}
id=A1
name=product A1
{}
id=A2
name=product A2
{}
id=2
name=product type B
products
element
{}
id=B1
name=product B1
etc.
This is what I need:
JSON
productCategoriesList
{}
id=1
name=product type A
products
{}
id=A1
name=product A1
{}
id=A2
name=product A2
{}
id=2
name=product type B
products
{}
id=B1
name=product B1
etc.
(I probably don't need to tell you that I'm a bit of a hack. As such, I appreciate your assistance and your humility as you accept my hacky-ness.)
Thanks!