Hi, I'm new to XSLT and I can't resolve the following problem:
I have a xml file like this:
<root>
<subset>
<e id="A"></e>
<e id="C"></e>
</subset>
<data>
<info id="A" order="3" name="ANode"></info>
<info id="B" order="4" name="BNode"></info>
<info id="C" order="1" name="CNode"></info>
<info id="D" order="2" name="DNode"></info>
</data>
</root>
And I want to produce this:
<root>
<newnode id="C" order="1" name="CNode"></newnode>
<newnode id="A" order="3" name="ANode"></newnode>
</root>
As you can see the idea is to "complete" the subset of ids by retrieving the respective info, and sort them accordingly to their order specified on <data>
.
Notice that <data>
is supposed to have a lot of child nodes.
Also, I'm separating the nodes with the information on the <data>
element from the subsets of ids, because I will have many subsets and I don't want to have repeated information "everywhere".
Thanks in advanced.