Please help, I’m an XSLT newbie and I’m trying to transform one XML format into another.
I need to extract unique attribute values and transform the values into a new format. The example XML below shows the original and new/target format.
I've spent ages trying to do this without any enjoy. Can anyone help out or give me some pointers?
Original format:
<base>
<level>
<level2 Name ="AA" value="1"/>
</level>
<level>
<level2 Name ="BB" value="2"/>
</level>
<level>
<level2 Name ="BB" value="3"/>
</level>
<level>
<level2 Name ="CC" value="4"/>
</level>
<level>
<level2 Name ="AA" value="5"/>
</level>
</base>
New format:
<base>
<levelNames>
<level level2Name ="AA"/>
<level level2Name ="BB"/>
<level level2Name ="CC"/>
</levelNames>
</base>
Thanks a lot.