Skip to Content
0
Feb 24, 2014 at 05:21 PM

Split XML into multiple records

569 Views

Hi All,

I have to split an XML field from a data type into multiple records on the target side.

For eg: If the source XML string is something like this:

<XML_STRING>

<Data>

<name>abc</name>

<place></place>

<addr1> </addr1>

<addr2></addr2>

</place>

<name>xyz<name>

<place>

<addr1></addr1>

<addr2></addr2>

</place>

</Data>

</XML_STRING>

Since the above XML string has two records in it (each record includes name and place), I would like to split those two into two separate records in the target structure and send it to ECC.

How can I achieve this in PI mapping. Here in this case I cannot even differentiate between <> </> to split the messages since a single records might have multiple sub nodes in it. It is only believed that when "<name>" repeats again in the XML that would be a start of new record. Based upon that I need to split the records.

Thanks in advance!!