Skip to Content

Creating target nodes from parent and multiple child nodes

Hello Experts,

I have an XML with parent and nested child nodes. For each child node I need to have a target node. How can I achieve this with message mapping or XSLT mapping. When I try using message mapping (below), I am getting only the first child.

Here is XML input (there are more fields in the XML but for simplicity I am only using few fields here):

<A_BusinessPartner>
<A_BusinessPartnerType>
<Supplier>VN112233</Supplier>
<to_Supplier>
<A_SupplierType>
<to_SupplierCompany>
<A_SupplierCompanyType>
<CompanyCode>1000</CompanyCode>
</A_SupplierCompanyType>
<A_SupplierCompanyType>
<CompanyCode>1010</CompanyCode>
</A_SupplierCompanyType>
</to_SupplierCompany>
</A_SupplierType>
</to_Supplier>
<BusinessPartner>VN112233</BusinessPartner>
</A_BusinessPartnerType>
</A_BusinessPartner>

The desired output is:

<A_VENDORDATA>
<A_VENDORDATAType>
<Supplier>VN112233</Supplier>
<CompanyCode>1000</CompanyCode>
</A_VENDORDATAType>
<A_VENDORDATAType>
<Supplier>VN112233</Supplier>
<CompanyCode>1010</CompanyCode>
</A_VENDORDATAType>
</A_VENDORDATA>

Any help is appreciated. Thanks!

9sexk.png (32.6 kB)
yfvw6.png (34.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers