Transform to remove the duplicate, take one element from duplicates

wingender

New Member
Question is similar to this , earlier question Which Dimitre has answered already. There is a slight modification in the response xml. However this time, we need one element to be taken from the repeating blocks. Not sure if we can use xsl key function here.my input xml\[code\]<M> <a> <b> <c f="123"> <key>Al</key> <e NO="678"> <f>Y</f> <g> <h>FTO</h> </g> </e> </c> </b> </a> <a> <b> <c f="123"> <key>Al</key> <e NO="678"> <f>Y</f> <g> <h>FTO</h> </g> </e> </c> </b> </a> <a> <b> <c f="567"> <key>Al</key> <e NO="678"> <f>Y</f> <g> <h>FTO</h> </g> </e> </c> </b> </a> <a> <b> <somethingelse/> </b> </a></M>\[/code\]my desired output xml - notice that in addition to removing the duplicate, we need to take the key element from repeating blocks. It may or may not be the same.\[code\]<M> <a> <b> <c f="123"> <key>Al</key> <key>Al</key> <e NO="678"> <f>Y</f> <g> <h>FTO</h> </g> </e> </c> </b> </a> <a> <b> <c f="567"> <key>Al</key> <e NO="678"> <f>Y</f> <g> <h>FTO</h> </g> </e> </c> </b> </a> <a> <b> <somethingelse/> </b> </a></M>\[/code\]
 
Back
Top