XSlt Code help
Here should go questions about transforming XML with XSLT and FOP.
			- 
				coolguy7262
- Posts: 1
- Joined: Tue Mar 27, 2012 4:22 am
XSlt Code help
Post by coolguy7262 »
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.
  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.
			
			
									
									
						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.
  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.
			
				Jump to
				
			
		
			
			
	
	- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service