1 17 package com.sun.syndication.io.impl; 18 19 import org.jdom.*; 20 21 23 public class RSS091NetscapeParser extends RSS091UserlandParser { 24 25 public RSS091NetscapeParser() { 26 this("rss_0.91N"); 27 } 28 29 protected RSS091NetscapeParser(String type) { 30 super(type); 31 } 32 33 static final String ELEMENT_NAME = "rss"; 34 static final String PUBLIC_ID = "-//Netscape Communications//DTD RSS 0.91//EN"; 35 static final String SYSTEM_ID = "http://my.netscape.com/publish/formats/rss-0.91.dtd"; 36 37 public boolean isMyType(Document document) { 38 boolean ok = false; 39 Element rssRoot = document.getRootElement(); 40 ok = rssRoot.getName().equals("rss"); 41 if (ok) { 42 ok = false; 43 Attribute version = rssRoot.getAttribute("version"); 44 if (version!=null) { 45 ok = version.getValue().equals(getRSSVersion()); 46 if (ok) { 47 ok = false; 48 DocType docType = document.getDocType(); 49 50 if (docType!=null) { 51 ok = ELEMENT_NAME.equals(docType.getElementName()); 52 ok = ok && PUBLIC_ID.equals(docType.getPublicID()); 53 ok = ok && SYSTEM_ID.equals(docType.getSystemID()); 54 } 55 } 56 } 57 } 58 return ok; 59 } 60 61 protected boolean isHourFormat24(Element rssRoot) { 62 return false; 63 } 64 65 protected String getTextInputLabel() { 66 return "textinput"; 67 } 68 69 } 70 | Popular Tags |