Hi all
I'm a noob in XSLT and I need help for doing something...
I have a XML like this:
Code:
<country name="Test">
<page id="a">
<banner id="1">
</banner>
</page>
<page id="b">
<banner id="1">
</banner>
</page>
</country>
<attribute banner_id="1" name="description">This is a test</attribute>
<attribute banner_id="1" name="url">This is an URL</attribute>
What I need to is to "nest" the <attribute>'s elements to every banner that matches the ID, and then delete all the <attribute>'s that are not nested... The resulting XML must be like this:
Code:
<country name="Test">
<page id="a">
<banner id="1">
<attribute banner_id="1" name="description">This is a test</attribute>
<attribute banner_id="1" name="url">This is an URL</attribute>
</banner>
</page>
<page id="b">
<banner id="1">
<attribute banner_id="1" name="description">This is a test</attribute>
<attribute banner_id="1" name="url">This is an URL</attribute>
</banner>
</page>
</country>
I can have the same many times spread in many different pages, but I'll have the banner attrributes only once, in the of my XML...
Thanks!