Skip to Content
0
Former Member
Dec 06, 2011 at 10:01 AM

Graphical Mapping issue

27 Views

Hi gurus,

we have a following challenge to solve;

INPUT

<root>
<header>
	<stats>
		<ID>AAA</ID>
		<color>green</color>
    	</stats>	
    	<stats>
		<ID>BBB</ID>
		<color>blue</color>
    	</stats>
    	<stats>
		<ID>CCC</ID>
		<color>red</color>
    	</stats>
</header>
<item>
	<order>
		<ID>AAA</ID>
		<value>1001</ID>
   	</order>
   	<order>
		<ID>AAA</ID>
		<value>1002</ID>
   	</order>
   	<order>
		<ID>BBB</ID>
		<value>1003</ID>
   	</order>
   	<order>
		<ID>CCC</ID>
		<value>1004</ID>
   	</order>
<item>
</root>

NEEDED OUTPUT

<root>
<header>
	<stats>
		<ID>AAA</ID>
		<color>green</color>
	<order>
		<ID>AAA</ID>
		<value>1001</ID>
   	</order>
   	<order>
		<ID>AAA</ID>
		<value>1002</ID>
   	</order>
    	</stats>	
    	<stats>
		<ID>BBB</ID>
		<color>blue</color>
	<order>
		<ID>BBB</ID>
		<value>1003</ID>
   	</order>
    	</stats>
    	<stats>
		<ID>CCC</ID>
		<color>red</color>
	<order>
		<ID>CCC</ID>
		<value>1004</ID>
   	</order>
    	</stats>
</header>
 

Who can help me?

Thanx in advance for any hints!

Regards,

PM