Serialize XML array of dict

Hi
I have this input data

[
  {
    "image": "2.jpg"
  },
  {
    "image": "3.jpg"
  },
  {
    "image": "4.jpg"
  },
  {
    "image": "5.jpg"
  }
]

i used mapper serialize: XML and i got

<images>
    <image>1.jpg</image>
</images>
<images>
    <image>2.jpg</image>
</images>
<images>
    <image>3.jpg</image>
</images>
<images>
    <image>4.jpg</image>
</images>
<images>
    <image>5.jpg</image>
</images>

but i need to got

<images>
    <image>1.jpg</image>
    <image>2.jpg</image>
    <image>3.jpg</image>
    <image>4.jpg</image>
    <image>5.jpg</image>
</images>

Hi @vosy ,

Thank you for contacting Alumio. I assume the expected final result is in XML format, so please correct me if I was wrong.
By assuming it, You can try these two steps to achieve that,
First, use “Move using pattern” or “Copy using pattern” to move/copy array image data from root *.image to images.image.$1

Second, you can use “Value mapper” → “Serialize: XML” to convert it into XML format.

Please give it a try.

thank you very much!, it works, as always :slight_smile:

1 Like