Android: RSS feed

Problem of SAXParser CNN RSS (copyright)

Problem: It cannot read special character (c) in copyright tag
Solution: use tagsoup instead

import org.ccil.cowan.tagsoup.Parser;

/*SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();

XMLReader xr = sp.getXMLReader();

RSSHandler myHandler = new RSSHandler(id);
xr.setContentHandler(myHandler);

xr.parse(new InputSource(url.openStream()));
rssfeed = myHandler.getrssfeed(0);
*/


XMLReader xr = new Parser();

RSSHandler myHandler = new RSSHandler(id);
xr.setContentHandler(myHandler);

xr.parse(new InputSource(url.openStream()));
rssfeed = myHandler.getrssfeed(0);

Comments

Popular posts from this blog

Linking verb - seem, sound, smell, appear, become, get, feel (Verb of Senses)

Phrasal Verb (กิริยาวลี) ที่ใช้บ่อย

If Clause 3 แบบ (Conditional Statement)