With the following XML :
<Sections><Section Type="Type1" Text="blabla1"><Section Type="Type2" Text="blabla2"/> </Section></Sections>
I want to produce the following output :
<Sections><Type1 Text="blabla1"><Type2 Text="blabla2"/></Type1></Sections>
I’m playing with XSLT since many hours, I cant even figure out something to start with… There are many good example on XLST transformation but I’m still missing something about recursivity and using the Type attribute to create my node. How to transform any section node in the document to its corresponing type attribute?
Any tutorial that do something similar , xslt resources or anything to start with whould be great
Thanks
How’s this (as requested in comments, modified to convert in both directions):
Output when run on your first example:
Output when run on your second example: