XmlPullParser not parsing tags

SBlizzard

New Member
\[code\] <rss xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Urdunews</title><description></description><link>...</link><atom:link rel="next"/><pubDate>Tue, 03 Jul 2012 11:32:20 +0000</pubDate><generator>http://pipes.yahoo.com/pipes/</generator><item>...</item><item>...</item><item>...</item><item>...</item><item>...</item><item>...</item><item>...</item><item>...</item><item>...</item><item>...</item><item>...</item><item>...</item><item>...</item><item>...</item><item><title>???????? ????? ??????? ????? ?? ???? ??</title><link>http://www.bbc.co.uk/urdu/india/2012/07/120703_india_pak_talks_sz.shtml</link><description><div class="g-container story-body"> <div class="bodytext"> <div class="module "> <div class="image img-w304"><img width="304" height="171" src="http://wscdn.bbc.co.uk/worldservice/assets/images/2012/03/04/120304052201_india_pak_flags.jpg" alt=""/><p class="caption">??????? ??? ????? ?? ?????? ??? ??? ???? ?? ??? ??? ?? ???? ??</p> </div> </div> <p class="ingress">??????? ?? ??????? ????? ???? ???? ?????? ???? ?????? ?? ???? ???? ?????? ?? ?? ???? ??????? ?? ??? ??? ?? ??? ???? ?? ??? ????? ????</p> <p>?????? ???? ?? ??? ??? ?? ???? ?? ????? ?? ???? ?????? ????? ?? ??????? ???? ??????? ?? ?????? ?? ??? ????</p> <p>??? ?????? ?? ??? ?????? ????? ????? ?? ??? ??? ??? ???? ?????? ?? ??? '' ?? ???? ???? ??? ????? ???? ?????? ?? ?????? ?? ???? ????? ???? ?? ????? ??? ??? ? ??????? ????? ???? ? ????? ??? ??????? ????????? ???? ????? ?? ?? ???? ??? ???????? ??? ??? ???? ???''</p> <p>???? ?????? ?? ??? ?? ??? ?? ??? ??? ???????? ????????? ????? ?? ???? ??????? ?? ??? ??? ?? ??? ??? ??? ??? ????</p> <p>???? ????? ??? ??? ??? ??????? ??? ???? ??? ????? ??? ???? ????? ?????? ???? ?? ????? ??? ???? ?????? ?????? ??? ??? ??????? ?? ????? ??????? ?? ??? ??? ?? ??? ??? ???? ????</p> <div class="module "> <div class="box bx-quote"> <div class="content"> <div class="body"> <blockquote> <p><span class="start-quote">"</span>?? ???? ???? ??? ????? ???? ?????? ?? ?????? ?? ???? ????? ???? ?? ????? ??? ??? ? ??????? ????? ???? ? ????? ??? ??????? ????????? ???? ????? ?? ?? ???? ??? ???????? ??? ??? ???? ???<span class="end-quote">"</span></p> </blockquote> <div class="person"> <div class="person-info"> <p class="name">????? ???? ??????</p> </div> </div> </div> </div> </div> </div> <p>??????? ?? ????? ???? ????? ???? ????? ?? ?????? ???? ?? ??? ??? ?? ???? ?????? ??????? ?? ?? ?? ??? ??? ??? ????? ?? ???? ???</p> <p>??????? ?? ?? ??? ???? ??? ????? ????? ?? ???? ???? ?? ?? ?????? ?????? ?? ?? ??? ??? ?? ??? ??? ??? ?????? ???? ??? ??? ?????? ???? ???? ???? ?? ???? ???????</p> <p>??? ?? ????? ?? ???? ????? ?? ??? ???? ??? ??? ??? ?? ??? ?? ??? ??? ??? ??????? ?? ??????? ????? ???? ?????? ?? ??? ??? ?? ???? ???</p> <p>?? ?????? ??? ???? ??? ?? ??? ?? ?? ??? ?? ??? ????? ????? ?? ????? ??? ????? ??? ???? ????? ??? ??? ???? ?? ????? ??? ?? ????? ?? ????? ?? ???? ??? ?? ??? ?????? ???? ??????? ?? ???? ?? ????? ?? ??????? ???</p> <p>?? ?? ????? ??? ???? ?? ???? ??? ???? ?????? ?? ??? ’?? ??? ?????? ????? ?? ??? ??? ??????? ?? ???? ??????? ???? ?? ??? ?? ?? ?? ???? ??? ?? ??? ?? ????? ??????‘</p> <p>?? ???? ??? ??? ????? ?? ???? ????? ?? ??? ?? ????? ??? ??????? ?? ?????? ?????? ??????? ???? ????? ??? ????? ????? ??? ?????? ???? ??? ??? ???</p> </div> </div> <div class="g-container story-body"></div></description><guid isPermaLink="false">tag:www.bbcurdu.com,2012-07-03:18355868</guid><pubDate>Tue, 03 Jul 2012 10:24:05 +0000</pubDate></item></channel></rss>\[/code\]And I want to extract all the tags inside items in arrays.I have been searching for this parsing since long but codunt find it help is appreciated thanks. \[code\]XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); XmlPullParser xpp = factory.newPullParser(); xpp.setInput( new StringReader ( xml ) ); int eventType = xpp.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { xpp.getName(); if(eventType == XmlPullParser.START_DOCUMENT) { System.out.println("Start document"); } else if(eventType == XmlPullParser.START_TAG) { System.out.println("Start tag "+xpp.getName()); } else if(eventType == XmlPullParser.END_TAG) { System.out.println("End tag "+xpp.getName()); } else if(eventType == XmlPullParser.TEXT) { System.out.println("Text "+xpp.getText()); } eventType = xpp.next(); }\[/code\]Above is the code I am trying to use but i am not able to parse the tags inside item can any 1 plz help me thanks !
 
Back
Top