summaryrefslogtreecommitdiff
path: root/src/de/podfetcher/syndication/namespace/rss20
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-06-24 14:48:15 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-06-24 14:48:15 +0200
commite128e6fd6e91064163b7c857609a73c4b5413fa6 (patch)
tree8211e78976043b7d740ba6f87ad00ea399518e25 /src/de/podfetcher/syndication/namespace/rss20
parenta63e975d87bd19e5a202cdf6813071b81f8c6ccc (diff)
downloadAntennaPod-e128e6fd6e91064163b7c857609a73c4b5413fa6.zip
description-tag is now parsed properly
Diffstat (limited to 'src/de/podfetcher/syndication/namespace/rss20')
-rw-r--r--src/de/podfetcher/syndication/namespace/rss20/NSRSS20.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/de/podfetcher/syndication/namespace/rss20/NSRSS20.java b/src/de/podfetcher/syndication/namespace/rss20/NSRSS20.java
index 823614898..fc3a3927b 100644
--- a/src/de/podfetcher/syndication/namespace/rss20/NSRSS20.java
+++ b/src/de/podfetcher/syndication/namespace/rss20/NSRSS20.java
@@ -41,6 +41,8 @@ public class NSRSS20 extends Namespace {
public final static String ENC_LEN = "length";
public final static String ENC_TYPE = "type";
+ private StringBuffer descriptionBuf;
+
@Override
public SyndElement handleElementStart(String localName, HandlerState state,
Attributes attributes) {
@@ -56,6 +58,8 @@ public class NSRSS20 extends Namespace {
.getValue(ENC_LEN)), attributes.getValue(ENC_TYPE)));
} else if (localName.equals(IMAGE)) {
state.getFeed().setImage(new FeedImage());
+ } else if (localName.equals(DESCR)) {
+ descriptionBuf = new StringBuffer();
}
return new SyndElement(localName, this);
}
@@ -78,11 +82,7 @@ public class NSRSS20 extends Namespace {
state.getFeed().getImage().setTitle(IMAGE);
}
} else if (top.equals(DESCR)) {
- if (second.equals(CHANNEL)) {
- state.getFeed().setDescription(content);
- } else if (second.equals(ITEM)) {
- state.getCurrentItem().setDescription(content);
- }
+ descriptionBuf.append(content);
} else if (top.equals(LINK)) {
if (second.equals(CHANNEL)) {
state.getFeed().setLink(content);
@@ -102,6 +102,15 @@ public class NSRSS20 extends Namespace {
public void handleElementEnd(String localName, HandlerState state) {
if (localName.equals(ITEM)) {
state.setCurrentItem(null);
+ } else if (localName.equals(DESCR)) {
+ SyndElement secondElement = state.getSecondTag();
+ String second = secondElement.getName();
+ if (second.equals(CHANNEL)) {
+ state.getFeed().setDescription(descriptionBuf.toString());
+ } else {
+ state.getCurrentItem().setDescription(descriptionBuf.toString());
+ }
+ descriptionBuf = null;
}
}