Skip to Content
0
Aug 28, 2018 at 09:41 PM

How to split XML into small messages and merge back to a single XML

2470 Views Last edit Aug 28, 2018 at 11:37 PM 2 rev

I have a requirement where to need to split a large XML file, make a decision, and merge back to one XML per the result.

Here is the format

CSV to XML - Incoming XML

<XML_File>

<File>

</A>

</File>

<File>

</A>

</File>

<File>

</B>

</File>

<File>

</B>

</File>

</XML_File>

General Split - by Xpath //File so a decsion could be made

Route 1 if the Xpath condtion = A

Route 2 if the Xpath condition = B

==> I need to Merge or combine the result back into one XML file

Not able to achieve this via gather or aggregator function after routing.

Desired output for Route A

<XML_file>

<File>

</A>

</File>

<File>

</A>

</File>

</XML_file>

Same for Route B

Any help or suggestion is appreciated.