Monday, 2 February 2015

Extracting fields from xml using mule splitter or xslt



Hi below is my input xml i want to spit the xml by row





<root>
<row1>
<Product>abc</Product>
<price>20</price>
<discount>10%</discount>
</row1>
<row2>
<Product>def</Product>
<price>120</price>
<discount>11%</discount>
</row2>
<row3>
<Product>ghi</Product>
<price>210</price>
<discount>5%</discount>
</row3>
</root>



The output xml should look like below First XML



<trx>
<Product>abc</Product>
<discount>10%</discount>
</trx>




Second XML




<trx>
<Product>def</Product>
<discount>11%</discount>
</trx>



And so on ,Do i have to use splitter or xslt what will be the xslt code to achieve this.I need to change the root name and also remove the field price from the original xml


No comments:

Post a Comment