XSlt Code help

Here should go questions about transforming XML with XSLT and FOP.
coolguy7262
Posts: 1

XSlt Code help

Tue Mar 27, 2012 4:57 am

Hello Experts.I need to create a xslt code for coverting the below xmls.
I have a source xml as below
<Header>
<FoodDietData>
<GTIN>123</GTIN>
<DietType>H&WB</DietType>
<DietCode>20</DietCode>
<FoodDietData>
<FoodDietData>
<GTIN>123</GTIN>
<DietType>H&WB</DietType>
<DietCode>95</DietCode>
<FoodDietData>
<FoodDietData>
<GTIN>230</GTIN>
<DietType>H&WB</DietType>
<DietCode>50</DietCode>
</FoodDietData>
</Header>

The output xml should be as follows.
For the same GTIN numbers :? and DietType = H&WB in the source xml ,this should be clubbed together under CINXml tag as below.

<CINXml>
<Food&BeverageData>
<GTIN>123</GTIN>
<DietType>H&WB</DietType>
<DietCode>20</DietCode>
</Food&BeverageData>
<Food&BeverageData>
<GTIN>123</GTIN>
<DietType>H&WB</DietType>
<DietCode>95</DietCode>
</Food&BeverageData>
</CINXml>
<CINXml>
<Food&BeverageData>
<GTIN>230</GTIN>
<DietType>H&WB</DietType>
<DietCode>50</DietCode>
</Food&BeverageData>
</CINXml>

Please give some light on this.

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest