* @param eItem the item element to parse.
* @return the parsed RSSItem bean.
*/
protected Item parseItem(final Element rssRoot, final Element eItem, final Locale locale) {
final Item item = new Item();
final Element title = eItem.getChild("title", getRSSNamespace());
if (title != null) {
item.setTitle(title.getText());
}
final Element link = eItem.getChild("link", getRSSNamespace());
if (link != null) {
item.setLink(link.getText());
item.setUri(link.getText());
}
item.setModules(parseItemModules(eItem, locale));
final List<Element> foreignMarkup = extractForeignMarkup(eItem, item, getRSSNamespace());
// content:encoded elements are treated special, without a module, they have to be removed
// from the foreign markup to avoid duplication in case of read/write. Note that this fix
// will break if a content module is used
final Iterator<Element> iterator = foreignMarkup.iterator();
while (iterator.hasNext()) {
final Element element = iterator.next();
final Namespace eNamespace = element.getNamespace();
final String eName = element.getName();
if (getContentNamespace().equals(eNamespace) && eName.equals("encoded")) {
iterator.remove();
}
}
if (!foreignMarkup.isEmpty()) {
item.setForeignMarkup(foreignMarkup);
}
return item;
}