if (image != null) {
ParserUtils.matchCaseOfChildren(image, new String[] { "title", "url",
"link", "width", "height", "description" });
ImageIF rssImage = cBuilder.createImage(image.getChildTextTrim("title",
defNS), ParserUtils.getURL(image.getChildTextTrim("url", defNS)),
ParserUtils.getURL(image.getChildTextTrim("link", defNS)));
Element imgWidth = image.getChild("width", defNS);
if (imgWidth != null) {
try {
rssImage.setWidth(Integer.parseInt(imgWidth.getTextTrim()));
} catch (NumberFormatException e) {
logger.warn("Error parsing width: " + e.getMessage());
}
}
Element imgHeight = image.getChild("height", defNS);
if (imgHeight != null) {
try {
rssImage.setHeight(Integer.parseInt(imgHeight.getTextTrim()));
} catch (NumberFormatException e) {
logger.warn("Error parsing height: " + e.getMessage());
}
}
Element imgDescr = image.getChild("description", defNS);
if (imgDescr != null) {
rssImage.setDescription(imgDescr.getTextTrim());
}
chnl.setImage(rssImage);
}
// 0..1 textinput element