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

Pretest62_2

Sometime, Sometimes ใช้ยังไง

verbs of perception/sense กริยาที่บอกประสาทสังผัสทั้งห้า