summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-09-01 13:27:41 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-09-01 13:27:41 +0200
commitce0d14db42a87e3c788fa0e46d1a5550d3531e93 (patch)
tree16df56f0e2b34e465b723188efddd5d1bd029452 /src
parent21fd53c8bd0572f58d9e6ea425223007c4c09c73 (diff)
downloadAntennaPod-ce0d14db42a87e3c788fa0e46d1a5550d3531e93.zip
Prevented namespace URIs from being added more than once
Diffstat (limited to 'src')
-rw-r--r--src/de/danoeh/antennapod/syndication/handler/SyndHandler.java43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/de/danoeh/antennapod/syndication/handler/SyndHandler.java b/src/de/danoeh/antennapod/syndication/handler/SyndHandler.java
index 4582aabba..b17b33094 100644
--- a/src/de/danoeh/antennapod/syndication/handler/SyndHandler.java
+++ b/src/de/danoeh/antennapod/syndication/handler/SyndHandler.java
@@ -77,28 +77,31 @@ public class SyndHandler extends DefaultHandler {
public void startPrefixMapping(String prefix, String uri)
throws SAXException {
// Find the right namespace
- if (uri.equals(NSAtom.NSURI)) {
- if (prefix.equals(DEFAULT_PREFIX)) {
- state.defaultNamespaces.push(new NSAtom());
- } else if (prefix.equals(NSAtom.NSTAG)) {
- state.namespaces.put(uri, new NSAtom());
+ if (!state.namespaces.containsKey(uri)) {
+ if (uri.equals(NSAtom.NSURI)) {
+ if (prefix.equals(DEFAULT_PREFIX)) {
+ state.defaultNamespaces.push(new NSAtom());
+ } else if (prefix.equals(NSAtom.NSTAG)) {
+ state.namespaces.put(uri, new NSAtom());
+ if (AppConfig.DEBUG)
+ Log.d(TAG, "Recognized Atom namespace");
+ }
+ } else if (uri.equals(NSContent.NSURI)
+ && prefix.equals(NSContent.NSTAG)) {
+ state.namespaces.put(uri, new NSContent());
+ if (AppConfig.DEBUG)
+ Log.d(TAG, "Recognized Content namespace");
+ } else if (uri.equals(NSITunes.NSURI)
+ && prefix.equals(NSITunes.NSTAG)) {
+ state.namespaces.put(uri, new NSITunes());
+ if (AppConfig.DEBUG)
+ Log.d(TAG, "Recognized ITunes namespace");
+ } else if (uri.equals(NSSimpleChapters.NSURI)
+ && prefix.equals(NSSimpleChapters.NSTAG)) {
+ state.namespaces.put(uri, new NSSimpleChapters());
if (AppConfig.DEBUG)
- Log.d(TAG, "Recognized Atom namespace");
+ Log.d(TAG, "Recognized SimpleChapters namespace");
}
- } else if (uri.equals(NSContent.NSURI)
- && prefix.equals(NSContent.NSTAG)) {
- state.namespaces.put(uri, new NSContent());
- if (AppConfig.DEBUG)
- Log.d(TAG, "Recognized Content namespace");
- } else if (uri.equals(NSITunes.NSURI) && prefix.equals(NSITunes.NSTAG)) {
- state.namespaces.put(uri, new NSITunes());
- if (AppConfig.DEBUG)
- Log.d(TAG, "Recognized ITunes namespace");
- } else if (uri.equals(NSSimpleChapters.NSURI)
- && prefix.equals(NSSimpleChapters.NSTAG)) {
- state.namespaces.put(uri, new NSSimpleChapters());
- if (AppConfig.DEBUG)
- Log.d(TAG, "Recognized SimpleChapters namespace");
}
}