|
Dom4j probelm with clearContent method
PLease, can somehone tell me (some snipplet or so) what is the way to remove a node (for example <Channel> node in the following XML) from a XMl File ?
I would like the method to be
public Document removeListChannels(Document doc, List<String> cForRemove)
where cForRemove is a list of ChannelIds.
<?xml version="1.0" encoding="UTF-8"?>
<MiTV context="EPG:Now">
<ReturnCode>0</ReturnCode>
<ReturnMessage>Your request was successful...</ReturnMessage>
<Channel>
<ChannelId>MiTeleTV_4_DEM_19</ChannelId>
<ChannelName nav="1">Antena 3</ChannelName>
<ChannelLogo nav="1">http://localhost/IMG_MITV/channel/MiTeleTV_4.jpg</ChannelLogo>
</Channel>
<Channel>
<ChannelId>MiTeleTV_3_DEM_19</ChannelId>
<ChannelName nav="1">Cuatro</ChannelName>
<ChannelLogo nav="1">http://localhost/IMG_MITV/channel/MiTeleTV_426.jpg</ChannelLogo>
<Program programId="MiTeleTV_3_DEM_19_2007-11-17-18-54-00_1194963560496">
<Title>News</Title>
<ProgramStartTime nav="1">1h 54mn</ProgramStartTime>
<ProgramEndTime nav="1">6mn</ProgramEndTime>
</Program>
</Channel>
<Channel>
<ChannelId>MiTeleTV_2_DEM_19</ChannelId>
<ChannelName nav="1">La 2</ChannelName>
<ChannelLogo nav="1">http://localhost/IMG_MITV/channel/MiTeleTV_153.jpg</ChannelLogo>
</Channel>
<Channel>
<ChannelId>MiTeleTV_1_DEM_19</ChannelId>
<ChannelName nav="1">Tve</ChannelName>
<ChannelLogo nav="1">http://localhost/IMG_MITV/channel/MiTeleTV_152.jpg</ChannelLogo>
</Channel>
<Channel>
<ChannelId>MiTeleTV_0_DEM_19</ChannelId>
<ChannelName nav="1">Canal Promocional</ChannelName>
<ChannelLogo nav="1">http://localhost/IMG_MITV/channel/MiTeleTV_392.jpg</ChannelLogo>
</Channel>
<ClientURL nav="1">http://localhost2/client/Nokia/Nokia1.sis</ClientURL>
<IndexCurrent nav="1">0</IndexCurrent>
</MiTV>
Thanks in advace
Alejandra Ortega
Last edited by aorteu : 11-26-2007 at 01:17 PM.
|