I currently have the following XML file:
<Regions>
<Region>
<Code>AU</Code>
<Name>Austria</Name>
</Region>
</Regions>
<Channels>
<Channel>
<Code>00</Code>
<Name>Im a channel</Name>
</Channel>
...
</Channels>
<Programs>
<Program>
<Code>00</Code>
<Name>Program</Name>
</Program>
</Programs>
I would only like to keep the Channels path so that the output would look like this using an XSLT:
<Channels>
<Channel>
<Code>00</Code>
<Name>Im a channel</Name>
</Channel>
...
</Channels>
This transformation:
when applied on the provided XML document (fixed to be made well-formed):
produces the wanted, correct result:
Explanation:
Use of the identity rule, overriden for the top element (pass-through) and for any non-
Channelschildren of the top element (delete).