Five Stars

How to generate target XML file with multiple loops under same parent group element

Hi,

 

Can some help me with below scenario

 

Need to apply multiple loops(Product,Discounts) within a group element (Product_History)

Sample target format

<Product_History>
<Product>
<product-id>1</product-id>
<product-name>soap</product-name>
<product-price>12</product-price>
<Discounts>
<Discount>
<Discount-id>Sample</Discount-id>
</Discount>
<Discount>
<Discount-id>ProUser</Discount-id>
</Discount>
</Discounts>
</Product>
<Product>
<product-id>2</product-id>
<product-name>chocolate</product-name>
<product-price>121</product-price>
<Discounts>
<Discount>
<Discount-id>ProUser</Discount-id>
</Discount>
</Discounts>
</Product>
<Product>
<product-id>3</product-id>
<product-name>car</product-name>
<product-price>23465412</product-price>
<Discounts>
<Discount>
<Discount-id>Luckywinner</Discount-id>
</Discount>
<Discount>
<Discount-id>ProUser</Discount-id>
</Discount>
<Discount>
<Discount-id>top10</Discount-id>
</Discount>
</Discounts>
</Product>

</Product_History>

 

 

Thanks in Advance.

Tags (3)