Я пытаюсь разобрать данные из этого RSS потокаСинтаксическая ссылка на изображение из средств массовой информации: тег миниатюрной RSS Feed андроида
http://www.thedailystar.net/frontpage/rss.xml
Я использую AsyncTask и я могу разобрать все другие тег, за исключением «СМИ : Ленфильм» Вот код
for (int i = 0; i < items.getLength(); i++) { Node currentchild = items.item(i); if (currentchild.getNodeName().equalsIgnoreCase("item")) { NewsItems item=new NewsItems(); NodeList itemchilds = currentchild.getChildNodes(); for (int j = 0; j < itemchilds.getLength(); j++) { Node current = itemchilds.item(j); if (current.getNodeName().equalsIgnoreCase("title")){ item.setTitle(current.getTextContent()); }else if (current.getNodeName().equalsIgnoreCase("description")){ item.setDescription(current.getTextContent()); }else if (current.getNodeName().equalsIgnoreCase("media:thumbnail")){ item.setMedia(current.getTextContent());//This is not working }else if (current.getNodeName().equalsIgnoreCase("link")){ item.setUrl(current.getTextContent()); } }
Я проверил предыдущие ответы относительно этой проблемы, но ни один из них не работает для меня.
Спасибо!
Спасибо! Мне пришлось изменить его на current.getAttributes(). GetNamedItem ("url"). GetTextContent() – Mufad
Отлично! Я уточню свой ответ. –