Google Answers Logo
View Question
 
Q: Transform flat outline-numbered XML to hierarchical , numbered XML ( No Answer,   1 Comment )
Question  
Subject: Transform flat outline-numbered XML to hierarchical , numbered XML
Category: Computers > Programming
Asked by: rohaab-ga
List Price: $15.00
Posted: 28 Jul 2003 09:57 PDT
Expires: 27 Aug 2003 09:57 PDT
Question ID: 236153
I would like an XSL stylesheet to process the Input XML shown below
into the output XML shown below. It should be able to handle any
number of outline levels.

Somehow it's got to recursively parse the input based on the Number
attribute and generate the hierarchy.


Input (XML)

<Items>
	<Item Number="1" Name="Level One" Description="Level One
Description"></Item>
	<Item Number="1.1"    Name="Sublevel One"      Description="Sublevel
One Description"		></Item>
	<Item Number="1.1.1"  Name="Sub-Sublevel One" 
Description="Description of Sub-Sublevel One"    ></Item>
	<Item Number="1.1.2"  Name="Sub-Sublevel Two" 
Description="Description of Sub-Sublevel Two"    ></Item>
	<Item Number="1.2"    Name="Sublevel Two"      Description="Sublevel
Two Description"           ></Item>
	<Item Number="2"      Name="Level Two"         Description="Level Two
Description"              ></Item>
</Items>

Desired Output (XML)

<Items>
	<Item Number="1" Name="Level One" Description="Level One
Description">
		<Item Number="1.1" Name="Sublevel One" Description="Sublevel One
Description">
			<Item Number="1.1.1" Name="Sub-Sublevel One"
Description="Description of Sub-Sublevel One"></Item>
			<Item Number="1.1.2" Name="Sub-Sublevel Two"
Description="Description of Sub-Sublevel Two"></Item>
		</Item>
		<Item Number="1.2" Name="Sublevel One" Description="Sublevel One
Description"></Item>
	</Item>	
	<Item Number="2" Name="Level Two" Description="Level Two
Description"></Item>
</Items>

Request for Question Clarification by mathtalk-ga on 13 Aug 2003 16:03 PDT
Hi, rohaab-ga:

I have an idea about how to do this.  Are you still interested in an answer?

regards, mathtalk-ga
Answer  
There is no answer at this time.

Comments  
Subject: Re: Transform flat outline-numbered XML to hierarchical , numbered XML
From: workingstorage-ga on 04 Aug 2003 08:44 PDT
 
Have you resolved this yet?

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy