* @return the parsed Channel bean.
*/
protected WireFeed parseChannel(Element rssRoot) {
Element eChannel = rssRoot.getChild("channel", getRSSNamespace());
Channel channel = new Channel(getType());
Element e = eChannel.getChild("title",getRSSNamespace());
if (e!=null) {
channel.setTitle(e.getText());
}
e = eChannel.getChild("link",getRSSNamespace());
if (e!=null) {
channel.setLink(e.getText());
}
e = eChannel.getChild("description",getRSSNamespace());
if (e!=null) {
channel.setDescription(e.getText());
}
channel.setImage(parseImage(rssRoot));
channel.setTextInput(parseTextInput(rssRoot));
// Unfortunately Microsoft's SSE extension has a special case of
// effectively putting the sharing channel module inside the RSS tag
// and not inside the channel itself. So we also need to look for
// channel modules from the root RSS element.
List allFeedModules = new ArrayList();
List rootModules = parseFeedModules(rssRoot);
List channelModules = parseFeedModules(eChannel);
if (rootModules != null) {
allFeedModules.addAll(rootModules);
}
if (channelModules != null) {
allFeedModules.addAll(channelModules);
}
channel.setModules(allFeedModules);
channel.setItems(parseItems(rssRoot));
List foreignMarkup =
extractForeignMarkup(eChannel, channel, getRSSNamespace());
if (foreignMarkup.size() > 0) {
channel.setForeignMarkup(foreignMarkup);
}
return channel;
}