[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XML to XML

Subject: RE: XML to XML
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 27 Mar 2003 09:04:36 -0000
xml multiple categories
It sounds as if your problem is in finding a design pattern for this
problem.

The problem is a multi-level grouping problem, where the first-level
grouping key is subsstring(code, 1, 1) and the second-level grouping key
is substring(code, 2, 1). 

With this knowledge you can apply the standard Muenchian grouping
technique as described at http://www.jenitennison.com/xslt/grouping, and
in all good textbooks.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jim Han
> Sent: 26 March 2003 20:25
> To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'
> Subject:  XML to XML
> 
> 
> I need some help in writing xsl to transform XML to XML.
> I am getting lost in concepts of having multiple templates
> 
> Original:
> <Categories>
> 	<Category>
> 		<Code>A</Code>
> 		<Description>Airplanes</Description>
> 	</Category>
> 	<Category>
> 		<Code>AA</Code>
> 		<Description>Airplanes (ARF)</Description>
> 	</Category>
> 	<Category>
> 		<Code>AAE</Code>
> 		<Description>Airplanes (ARF), Electric</Description>
> 	</Category>
> 	<Category>
> 		<Code>AAG</Code>
> 		<Description>Airplanes (ARF), Giant</Description>
> 	</Category>
> 	<Category>
> 		<Code>AAP</Code>
> 		<Description>Airplanes (ARF), Sailplane</Description>
> 	</Category>
> 	<Category>
> 		<Code>B</Code>
> 		<Description>Boats</Description>
> 	</Category>
> 	<Category>
> 		<Code>BA</Code>
> 		<Description>Boats (ARF)</Description>
> 	</Category>
> 	<Category>
> 		<Code>BAE</Code>
> 		<Description>Boats (ARF), Electric</Description>
> 	</Category>
> <Categories>
> 
> 
> Final Result - where one letter, two letter, and three letter 
> categories are nested.
> 
> 
> <Categories>
> 	<LevelOneCategory Code="A" Description="Airplanes">
> 		<LevelTwoCategory Code="AA" 
> Description="Airplanes (ARF)">
> 			<LevelThreeCategory  Code="AAE"
> Description="Airplanes (ARF), Electric"/>
> 			<LevelThreeCategory  Code="AAG"
> Description="Airplanes (ARF), Giant"/>
> 			<LevelThreeCategory  Code="AAP"
> Description="Airplanes (ARF), Sailplane"/>
> 		</LevelTwoCategory>
>       </LevelOneCategory>
> 	<LevelOneCategory Code="B" Description="Boats">
> 		<LevelTwoCategory Code="BA" Description="Boats (ARF)">
> 			<LevelThreeCategory  Code="BAE" 
> Description="Boats
> (ARF), Electric"/>
> 		</LevelTwoCategory>
>       </LevelOneCategory>
> <Categories>
> 
> Thank you!
> 
> 
> Jim Han
> 
> 
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.