Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
- <?xml-stylesheet type="text/xsl" href="rss.xsl"?>
- <channel>
- <title>MyRSS</title>
- <atom:link href="http://www.example.com/rss.php" rel="self" type="application/rss+xml" />
- <link>http://www.example.com/rss.php</link>
- <description>MyRSS</description>
- <language>en-us</language>
- <pubDate>Tue, 22 May 2018 13:15:15 +0530</pubDate>
- <item>
- <title>Title 1</title>
- <pubDate>Tue, 22 May 2018 13:14:40 +0530</pubDate>
- <link>http://www.example.com/news.php?nid=47610</link>
- <guid>http://www.example.com/news.php?nid=47610</guid>
- <description>bla bla bla</description>
- </item>
- </channel>
- </rss>
- VTDGen vg = new VTDGen();
- if (vg.parseHttpUrl(appDataBean.getUrl(), true)) {
- VTDNav vn = vg.getNav();
- AutoPilot ap = new AutoPilot(vn);
- ap.selectXPath("/channel/item");
- int result = -1;
- while ((result = ap.evalXPath()) != -1) {
- if (vn.matchElement("item")) {
- do {
- //do something with the contnets in the item node
- Log.d("VTD", vn.toString(vn.getText()));
- } while (vn.toElement(VTDNav.NEXT_SIBLING));
- }
- }
- }
Add Comment
Please, Sign In to add comment