07-27-2021 01:36 PM
I have a scenario where main xml needs to be splitted into multiple xmls.
Main xml:-
<?xml version="1.0" encoding="UTF-8"?>
<Order>
<Main>
<Version>2.1</Version>
<SenderID>55544566</SenderID>
</Main>
<Data>
<OrderNumber>564434555</OrderNumber>
<OrderDate>2021-07-15</OrderDate>
<CurrencyCode>eur</CurrencyCode>
</Data>
<Lines>
<Line>
<OrderLineNumber>10</OrderLineNumber>
<VendorOrderLineNumber>10000</VendorOrderLineNumber>
<VendorPartNumber>66554</VendorPartNumber>
</Line>
<Line>
<OrderLineNumber>20</OrderLineNumber>
<VendorOrderLineNumber>20000</VendorOrderLineNumber>
<VendorPartNumber>6775</VendorPartNumber>
</Line>
</Lines>
</Order>
Split xml 1:-
<?xml version="1.0" encoding="UTF-8"?>
<Order>
<Main>
<Version>2.1</Version>
<SenderID>55544566</SenderID>
</Main>
<Data>
<OrderNumber>564434555</OrderNumber>
<OrderDate>2021-07-15</OrderDate>
<CurrencyCode>eur</CurrencyCode>
</Data>
<Lines>
<Line>
<OrderLineNumber>10</OrderLineNumber>
<VendorOrderLineNumber>10000</VendorOrderLineNumber>
<VendorPartNumber>66554</VendorPartNumber>
</Line>
</Lines>
</Order>
split xml 2:-
<?xml version="1.0" encoding="UTF-8"?>
<Order>
<Main>
<Version>2.1</Version>
<SenderID>55544566</SenderID>
</Main>
<Data>
<OrderNumber>564434555</OrderNumber>
<OrderDate>2021-07-15</OrderDate>
<CurrencyCode>eur</CurrencyCode>
</Data>
<Lines>
<Line>
<OrderLineNumber>20</OrderLineNumber>
<VendorOrderLineNumber>20000</VendorOrderLineNumber>
<VendorPartNumber>6775</VendorPartNumber>
</Line>
</Lines>
</Order>
how do I achieve it?
Solved! Go to Solution.
08-01-2021 10:19 AM
Try this one. Now even if it’s only one Line it will work.
Split_XML_Parent_2021_08_01.slp (13.0 KB)
Child pipeline is the same as above.
Regards,
Viktor
07-28-2021 03:24 AM
@Sahil you can try the attached pipeline. You have to replace input xml mapper with File reader and binary to document snap. and change input value xml_multi_content to $content in add identify tag mapper snap.
test_2021_07_28.slp (9.8 KB)
07-28-2021 05:19 AM
Hi, I realized that xml were not correctly formatted.
I have edited my question.
07-28-2021 05:31 AM
@Sahil Even now also you can use same pipeline, only replace your xml with my xml.
07-29-2021 04:38 PM
Hi @Supratim ,
It did not work. please look at the xml mentioned in the question.
Main and Data segment need to be kept in split xmls.