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

XML to XML Transformation question

Subject: XML to XML Transformation question
From: "Uslu, Cihan Y (MED)" <Cihan.Uslu@xxxxxxxxxx>
Date: Wed, 27 Mar 2002 08:59:09 -0600
xml transform to text
Hi, 
How to transform this incoming XML to targeted XML.?
For each <Body-Text> tag with string value of "To be eligible for CE
credit", I need to create a <module> element and for each <question> tag
create a child element named <assessment> and copy the xml/question,
xml/answer and distractorList/distractor and their contents as childs of
<assessment> tag. I tried this several times, but I can not copy
question, answer and distractor as childs of assessment, they became
siblings. Any help is appreciated. 

Thanks for the help.

Ci

TARGETED XML
--------------------------
<course>
<module>
	<assessment>
		<question>
		   <stem>
			<para>some text here</para>
		</stem>
		<answer> This is answer</answer>
		<distractor> This is distractor 1</distractor>
		<distractor> This is distractor 2</distractor>
		</question>
	</assessment>
	.....
</module>
<module>
	<assessment>
		<question>
		   <stem>
			<para>some more text here</para>
		</stem>
		<distractor> This is another distractor 1</distractor>
		<answer>This is another answer</answer>
		<distractor> This is another distractor 2</distractor>
		<distractor> This is another distractor 3</distractor>
		</question>
	</assessment>
	.....
</module>
</course>

		


INPUT XML
-------------
<XML>
<Body-Text>
	<A ID="pgfId-1119548"></A>
	To be eligible for CE credit
</Body-Text>
<question>some text here
	<A ID="pgfId-1117803"></A>
</question>
<distractorList>
	<distractor>	
		<A ID="pgfId-1116274"></A>
	</distractor>
</distractorList>
<answer>This is answer
	<A ID="pgfId-1116199"></A>
</answer>
<distractorList>
	<distractor>This is distractor 1
	<A ID="pgfId-1116200"></A>
	</distractor>
	<distractor>This is distractor 2
		<A ID="pgfId-1116201"></A>
	</distractor>
</distractorList>
......
<Body-Text>
<A ID="pgfId-1116876"></A>
	To be eligible for CE credit</Body-Text>
<Body-Text>
<A ID="pgfId-1116999"></A>
</Body-Text>
<question>some more text here
<A ID="pgfId-1117719"></A></question>
<distractorList>
<distractor> This is another Distractor 1
<A ID="pgfId-1117720"></A>
</distractor>
</distractorList>
<answer>This is another answer
<A ID="pgfId-1117721"></A>
</answer>
<distractorList>
<distractor>This is another Distractor 2
<A ID="pgfId-1117722"></A>
</distractor>
<distractor>This is another Distractor 3
<A ID="pgfId-1117723"></A>
</distractor>
</distractorList>
</XML>

 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.