Files
Athou_commafeed/src/main/java/com/commafeed/backend/rome/OPML11Parser.java

27 lines
619 B
Java
Raw Normal View History

2013-04-21 09:05:51 +02:00
package com.commafeed.backend.rome;
import org.jdom.Document;
import org.jdom.Element;
import com.sun.syndication.io.impl.OPML10Parser;
public class OPML11Parser extends OPML10Parser {
2013-07-25 09:17:33 +02:00
public OPML11Parser() {
super("opml_1.1");
}
2013-04-21 09:05:51 +02:00
@Override
public boolean isMyType(Document document) {
Element e = document.getRootElement();
2013-07-25 09:17:33 +02:00
if (e.getName().equals("opml") && (e.getChild("head") == null || e.getChild("head").getChild("docs") == null)
&& (e.getAttributeValue("version") == null || e.getAttributeValue("version").equals("1.1"))) {
2013-04-21 09:05:51 +02:00
return true;
}
return false;
};
}