I have some XML like this:
<doc>
<a a1="1" />
<a a1="1" a2="1" />
<a a2="1" a1="1" />
<a a2="1" />
</doc>
I need to transform it so that attributes of the node “a” decorate it as nodes, like this:
<doc>
<a1><a /></a1>
<a1><a2><a /></a2></a1>
<a2><a1><a /></a1></a2>
<a2><a/></a2>
</doc>
Would someone be so kind as to point the way to an XSLT solution?
Easiest is to recurse down a list of attributes:
which produces: