01: /*
02: * Copyright 2004 Sun Microsystems, Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: *
16: */
17: package com.sun.syndication.io.impl;
18:
19: import org.jdom.*;
20:
21: /**
22: */
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
52: .getElementName());
53: ok = ok
54: && PUBLIC_ID.equals(docType
55: .getPublicID());
56: ok = ok
57: && SYSTEM_ID.equals(docType
58: .getSystemID());
59: }
60: }
61: }
62: }
63: return ok;
64: }
65:
66: protected boolean isHourFormat24(Element rssRoot) {
67: return false;
68: }
69:
70: protected String getTextInputLabel() {
71: return "textinput";
72: }
73:
74: }
|