Merging and rearranging xml using xslt

_________

New Member
I am using XSLT for converting a XML derived from web and convert the same on the fly into the target xml file denoted as output .I am still unable to do so even after trying a lot , Can anyone please help me out with this conversion .Source XML
\[code\]<allocelement> <hd1>12</hd1> <hd2>14</hd2> <hd3>87</hd3> <alc>1</alc> <amount>4587</amount> <code>1111</code></allocelement><alloclement> <hd1>12</hd1> <hd2>14</hd2> <hd3>87</hd3> <alc>2</alc> <amount>80000</amount> <code>1111</code></alloclement><alloclement> <hd1>875</hd1> <hd2>455</hd2> <hd3>455</hd3> <alc>2</alc> <amount>80000</amount> <code>1112</code> </alloclement>\[/code\]Output Desired \[code\]<allocelement> <Codeheader> <code>1111</code> <hd1>12</hd1> <hd2>14</hd2> <hd3>87</hd3> <alc>1</alc> <amount>4587</amount> <alc>2</alc> <amount>80000</amount> </codeHeader> <CodeHeader> <code>1112</code> <hd1>875</hd1> <hd2>455</hd2> <hd3>455</hd3> <alc>2</alc> <amount>80000</amount> </CodeHeader></allocelement>\[/code\]The Grouping is on the basis of Code,[hd1,hd2,hd3] such that the different elements within which have the same Code and [hd1,hd2,hd3] will be merged and only show fields which are different viz. the and . Also I am using xslt 1.0 .
 
Back
Top