Hi all,
I am working on Rss feed parsing
I am able to parse rss feed
but i am getting some problem in reading
<content:encoded> tag which contains
lot of data only some part of data only it is not reading full data.
following is my code:
public class EventRssHandler extends DefaultHandler {
public static ArrayList<String> mylist_content = new
ArrayList<String>();
EventRssFeed _feed;
String _lastElementName = "";
boolean bFoundChannel = false;
final int RSS_CONTENT = 1;
int depth = 0;
int currentstate = 0;
public EventRssHandler() {
}
EventRssFeed getEventRssFeed() {
return _feed;
}
public void startDocument() throws SAXException {
_feed = new EventRssFeed();
}
public void endDocument() throws SAXException {
}
public void startElement(String namespaceURI, String localName,
String qName, Attributes atts) throws SAXException {
depth++;
if (localName.equals("channel")) {
currentstate = 0;
return;
}
if (localName.equals("item")) {
return;
}
if (localName.equalsIgnoreCase("encoded")) {
currentstate = RSS_CONTENT;
return;
}
currentstate = 0;
}
public void endElement(String namespaceURI, String localName, String
qName)
throws SAXException {
depth--;
if (localName.equals("item")) {
return;
}
}
public void characters(char ch[], int start, int length) {
String theString = new String(ch, start, length);
switch (currentstate) {
case RSS_CONTENT:
mylist_content.add(theString);
currentstate = 0;
break;
default:
mylist.add(listItems);
return;
}
}
Please help me
Thanks
Naveen.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en