Reputation: 1289
I have a XML payload
that contains the following example:
<Example>
<Brand>
<Id>987S</Id>
<logo>circle</logo>
<Item>
<Name>cologne1</Name>
<Item>
<Name>Bosque</Name>
</Item>
</Item>
<Item>
<Name>t-Shirt</Name>
</Item>
</Brand>
<Brand>
<Id>877823C</Id>
<logo>circle</logo>
<Item>
<Name>t-Shirt2</Name>
<Item>
<Name>t-Shirt black</Name>
<Item>
<Name>t-Shirt black with logo</Name>
</Item>
</Item>
</Item>
</Brand>
</Example>
I read the XML with DataWeave to transform the Example content to Array:
#[payload.Example.*Brand]
It returns a LinkedHashMap with two Objects. I use a for-each to loop and read each Brand object and the result is:
So, even if the brand object has two Items objects, it only returns one.
How could I solve this?
Upvotes: 0
Views: 206