This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problem with transforming-copying same level elements --2nd Posting--


I have tried to solve this problem almost all afternoon, but seems that
I got stucked, I'd appreciate your ideas on how to solve it. 
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.

Thanks..

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>To be eligible for CE credit</Body-Text>
<question>some text here</question>
<distractorList>
	<distractor>This is distractor 1</distractor>
</distractorList>
<answer>This is answer</answer>
<distractorList>
	<distractor>This is distractor 2</distractor>
	<distractor>This is distractor 3</distractor>
</distractorList>
......
<Body-Text>To be eligible for CE credit</Body-Text>
<question>some more text here</question>
<distractorList>
	<distractor> This is another Distractor 1</distractor>
</distractorList>
<answer>This is another answer</answer>
<distractorList>
	<distractor>This is another Distractor 2</distractor>
	<distractor>This is another Distractor 3</distractor>
</distractorList>
</XML>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]