android - How i get media:content url using by XML DOM Parser -



android - How i get media:content url using by XML DOM Parser -

i want parse metia:content tag using xml dom parser. here example:

<item> <title>ak saraya tek laf edemeyen yandaş yazardan, lokantaya eleştiri</title> <category>gündem</category> <description>&lt;a href=""&gt;&lt;img src="http://www.onyediyirmibes.com/images/haberler/thumbs2/ak_saraya_tek_laf_edemeyen_yandas_yazardan_lokantaya_elestiri_h11614.jpg" align="left" border="0" /&gt;&lt;/a&gt;1.4 milyar liraya inşa edilen ve özellikle sosyal medyada kaÇak saray olarak adlandırılan ak sarayın maliyeti için tek kelime edemeyen yandaş yazar, hırsını antepte bulunan bir restauranttan çıkardı.</description> <image>http://www.onyediyirmibes.com/images/haberler/ak_saraya_tek_laf_edemeyen_yandas_yazardan_lokantaya_elestiri_h11614.jpg</image> <media:content url="http://www.onyediyirmibes.com/images/haberler/ak_saraya_tek_laf_edemeyen_yandas_yazardan_lokantaya_elestiri_h11614.jpg" type="image/jpeg" medium="image" /> <media:thumbnail url="http://www.onyediyirmibes.com/images/haberler/ak_saraya_tek_laf_edemeyen_yandas_yazardan_lokantaya_elestiri_h11614.jpg" /> <enclosure url="http://www.onyediyirmibes.com/images/haberler/ak_saraya_tek_laf_edemeyen_yandas_yazardan_lokantaya_elestiri_h11614.jpg" length="50000" type="image/jpeg" /> <pubdate>wed, 12 nov 2014 00:08:51 +0300</pubdate> <link>http://www.onyediyirmibes.com/gundem/ak-saraya-tek-laf-edemeyen-yandas-yazardan-lokantaya-elestiri-h11614.html</link> <guid>http://www.onyediyirmibes.com/gundem/ak-saraya-tek-laf-edemeyen-yandas-yazardan-lokantaya-elestiri-h11614.html</guid> </item>

i can parse title tag this:

nodelist nodelistcountry = document.getelementsbytagname("item"); (int = 0; < nodelistcountry.getlength(); i++) { node node = nodelistcountry.item(i); element elementmain = (element) node; nodelist nodelisttext = elementmain .getelementsbytagname("link"); element elementtext = (element) nodelisttext.item(0); list.add(elementtext.getchildnodes().item(0).getnodevalue()); }

how can parse media:content tag?i need image's link download.can help me?

here should attribute in xml xmlns:media="http://search.yahoo.com/mrss/"

this defines element nodes , attributes alias/prefix media part of media rss namespace.

many of dom methods have variant ends 'ns' , namespace aware. illustration getelementsbytagnamens(string namespaceuri, string localname)

usage example:

nodelist nodelistmediacontent = elementmain .getelementsbytagname("http://search.yahoo.com/mrss/", "content");

note: xpath much easier way fetch info dom

android parsing dom

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -