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 com.sun.syndication.feed.rss.Item;
20: import org.jdom.Element;
21:
22: /**
23: */
24: public class RSS093Parser extends RSS092Parser {
25:
26: public RSS093Parser() {
27: this ("rss_0.93");
28: }
29:
30: protected RSS093Parser(String type) {
31: super (type);
32: }
33:
34: protected String getRSSVersion() {
35: return "0.93";
36: }
37:
38: protected Item parseItem(Element rssRoot, Element eItem) {
39: Item item = super .parseItem(rssRoot, eItem);
40: Element e = eItem.getChild("pubDate", getRSSNamespace());
41: if (e != null) {
42: item.setPubDate(DateParser.parseDate(e.getText()));
43: }
44: e = eItem.getChild("expirationDate", getRSSNamespace());
45: if (e != null) {
46: item.setExpirationDate(DateParser.parseDate(e.getText()));
47: }
48: e = eItem.getChild("description", getRSSNamespace());
49: if (e != null) {
50: String type = e.getAttributeValue("type");
51: if (type != null) {
52: item.getDescription().setType(type);
53: }
54: }
55: return item;
56: }
57:
58: }
|