user1092042
user1092042

Reputation: 1295

Getting the descrption in an xml feed

I am using the following link and am parsing the xml fields and displaying the titles in the list view. My issue is that the descrption contains html tags.

<description><![CDATA[<p>We had one of our best episodes yet talking about how to monetize apps through advertisements and how to create custom ones. In addition we taught how to implement analytics in your app and how important analytics are to improving user experience. Our special guest for the show was Scott Mountenay, a web developer who has entered the Android ecosystem. He speaks about his experience, opinions, and favourite things about developing for Android. Join us in another two weeks on April 5th for another great episode.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="296" id="utv206642" name="utv_n_61348"><param name="flashvars" value="loc=%2F&amp;autoplay=false&amp;vid=13501464&amp;locale=en_US&amp;hasticket=false&amp;id=13501464&amp;v3=1" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.ustream.tv/flash/viewer.swf" /><embed flashvars="loc=%2F&amp;autoplay=false&amp;vid=13501464&amp;locale=en_US&amp;hasticket=false&amp;id=13501464&amp;v3=1" width="480" height="296" allowfullscreen="true" allowscriptaccess="always" id="utv206642" name="utv_n_61348" src="http://www.ustream.tv/flash/viewer.swf" type="application/x-shockwave-flash" /></object></p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="296" id="utv418087" name="utv_n_63775"><param name="flashvars" value="loc=%2F&amp;autoplay=false&amp;vid=13502856&amp;locale=en_US&amp;hasticket=false&amp;id=13502856&amp;v3=1" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.ustream.tv/flash/viewer.swf" /><embed flashvars="loc=%2F&amp;autoplay=false&amp;vid=13502856&amp;locale=en_US&amp;hasticket=false&amp;id=13502856&amp;v3=1" width="480" height="296" allowfullscreen="true" allowscriptaccess="always" id="utv418087" name="utv_n_63775" src="http://www.ustream.tv/flash/viewer.swf" type="application/x-shockwave-flash" /></object></p>]]></description>

How would i display only the data which is meaningful. Also on clicking the list view what is the best layout to display this text and how would i go about creating it.

Upvotes: 0

Views: 95

Answers (1)

ρяσѕρєя K
ρяσѕρєя K

Reputation: 132982

Normally the parser ignores CDATA by definition, but in android you can get it by using the nexttoken() function to find it and then gettext to retrieve the text inside of it.

You can read about it on this page: http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html

Upvotes: 1

Related Questions