Recognize 'application/xml+xhtml' as valid link type for website

This commit is contained in:
daniel oeh 2013-04-09 18:57:44 +02:00
parent c4ef276467
commit d3ad2cfb8c
1 changed files with 9 additions and 1 deletions

View File

@ -45,6 +45,8 @@ public class NSAtom extends Namespace {
// type-values
private static final String LINK_TYPE_ATOM = "application/atom+xml";
private static final String LINK_TYPE_HTML = "text/html";
private static final String LINK_TYPE_XHTML = "application/xml+xhtml";
private static final String LINK_TYPE_RSS = "application/rss+xml";
/** Regexp to test whether an Element is a Text Element. */
@ -90,7 +92,13 @@ public class NSAtom extends Namespace {
} else if (parent.getName().matches(isFeed)) {
if (rel == null || rel.equals(LINK_REL_ALTERNATE)) {
String type = attributes.getValue(LINK_TYPE);
if (type != null && type.equals(LINK_TYPE_HTML)) {
/*
* Use as link if a) no type-attribute is given and
* feed-object has no link yet b) type of link is
* LINK_TYPE_HTML or LINK_TYPE_XHTML
*/
if ((type == null && state.getFeed().getLink() == null)
|| (type != null && (type.equals(LINK_TYPE_HTML) || type.equals(LINK_TYPE_XHTML)))) {
state.getFeed().setLink(href);
}
} else if (rel.equals(LINK_REL_PAYMENT)) {