Attribute attrTitle = feedElem.getAttribute("title");
String strTitle = "[No Title]";
if (attrTitle != null) {
strTitle = attrTitle.getValue();
}
FeedIF feed = new Feed(strTitle);
if (logger.isDebugEnabled()) {
logger.debug("Feed element found (" + strTitle + ").");
}
// get text attribute
Attribute attrText = feedElem.getAttribute("text");
String strText = "[No Text]";
if (attrText != null) {
strText = attrText.getValue();
}
feed.setText(strText);
// get attribute type (for example: 'rss')
Attribute attrType = feedElem.getAttribute("type");
String strType = "text/xml";
if (attrType != null) {
strType = attrType.getValue();
}
feed.setContentType(strType);
// TODO: handle attribute version (for example: 'RSS')
// get attribute xmlUrl
Attribute attrXmlUrl = feedElem.getAttribute("xmlUrl");
if (attrXmlUrl != null && attrXmlUrl.getValue() != null) {
feed.setLocation(ParserUtils.getURL(attrXmlUrl.getValue()));
}
// get attribute htmllUrl
Attribute attrHtmlUrl = feedElem.getAttribute("htmlUrl");
if (attrHtmlUrl != null && attrHtmlUrl.getValue() != null) {
feed.setSite(ParserUtils.getURL(attrHtmlUrl.getValue()));
}
// set current date
feed.setDateFound(dateParsed);
// add feed to collection
feedColl.add(feed);
}
return feedColl;