From dc3ae95a89b119271d8c5a514f8b32c044edd0ce Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Sat, 9 Jun 2012 10:58:04 +0200 Subject: [PATCH] Fixed startElement method in SyndHandler --- src/de/podfetcher/syndication/handler/FeedHandler.java | 1 + src/de/podfetcher/syndication/handler/SyndHandler.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/de/podfetcher/syndication/handler/FeedHandler.java b/src/de/podfetcher/syndication/handler/FeedHandler.java index 70cf5196b..4b33e11de 100644 --- a/src/de/podfetcher/syndication/handler/FeedHandler.java +++ b/src/de/podfetcher/syndication/handler/FeedHandler.java @@ -20,6 +20,7 @@ public class FeedHandler { RSSHandler handler = new RSSHandler(feed); try { SAXParserFactory factory = SAXParserFactory.newInstance(); + factory.setNamespaceAware(true); SAXParser saxParser = factory.newSAXParser(); saxParser.parse(new File(feed.getFile_url()), handler); } catch (SAXException e) { diff --git a/src/de/podfetcher/syndication/handler/SyndHandler.java b/src/de/podfetcher/syndication/handler/SyndHandler.java index 9cf5fb710..9ee604244 100644 --- a/src/de/podfetcher/syndication/handler/SyndHandler.java +++ b/src/de/podfetcher/syndication/handler/SyndHandler.java @@ -25,7 +25,11 @@ public abstract class SyndHandler extends DefaultHandler{ state.tagstack.push(qName); String[] parts = qName.split(":"); - Namespace handler = state.namespaces.get(parts[0]); + String prefix = ""; + if (parts.length >= 2) { + prefix = parts[0]; + } + Namespace handler = state.namespaces.get(prefix); if (handler != null) { handler.handleElement(localName, state, attributes); }