Rss-Rome, designed to read XML file

sponsored links
Core code:

java implementation code:

rssUrl = "http://218.206.234.34:8080/rss-xmlrpc/testRss/test.xml";

/ / rssUrl the definition of xml where the web address is a property, there are set-get method

URL url = new URL (getRssUrl ());

/ / New URL

XmlReader reader = new XmlReader (url);

/ / XmlReader from rome to read xml file provided by a class.

SyndFeedInput input = new SyndFeedInput ();

SyndFeed feed = input.build (reader);

List entries = feed.getEntries ();

/ / Get the xml file data on a collection item tag

List enList = new ArrayList ();

/ / SyndEntry of a collection is used to display the page

for (int i = 0; i <entries.size (); i + +) (

SyndEntry entry = (SyndEntry) entries.get (i);

enList.add (entry);

)

return enList;

/ / To the page of data returned SyndEntry combination of traversing the page

Page display code:

"%

List enList = rssT.parseRss ();

if (enList! = null & &! enList.isEmpty ()) (

for (int i = 0; i <enList.size (); i + +) (

SyndEntry entry = (SyndEntry) enList.get (i);

% "

<tr>

<td> <% = entry.getTitle ()%></ td>

<td>

<a href ="<%= entry.getLink ()%>"> address </ a>

</ td>

<td> <% = entry.getDescription (). getValue ()%></ td>

<td> <% = entry.getPublishedDate ()%></ td>

<td> <% = entry.getAuthor ()%></ td>

</ tr>

"%

)

)

% "

My page shows a very rough, probably understand the meaning on it.
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb
Tags:

Related Posts of Rss-Rome, designed to read XML file

  • Rss-Rome, designed to read XML file

    Core code: java implementation code: rssUrl = "http://218.206.234.34:8080/rss-xmlrpc/testRss/test.xml"; / / rssUrl the definition of xml where the web address is a property, there are set-get method URL url = new URL (getRssUrl ()); / / New ...

  • Rss-Rome reader reads the XML file

    Rss-Rome reader reads the XML file http://yueding920.blog.163.com/blog/static/352508902010521104649147/ Core code: java implementation code: rssUrl = "http://218.206.234.34:8080/rss-xmlrpc/testRss/test.xml"; / / RssUrl web address where the

  • Rss-Rome feed readers need to generate the XML file

    Rss-Rome feed readers need to generate the XML file / / Create input and output streams FileWriter fw = new FileWriter (rssPath); / / rssPath: parameter, the definition of xml output address, I chose a project on tomcat / / String rssPath = request.g ...

  • Rss-Rome polymerization required XML file reader

    Rss-Rome polymerization required XML file reader / / Create input and output streams FileWriter fw = new FileWriter (rssPath); / / RssPath: parameter, defined xml output of the address, I chose a project on tomcat / / String rssPath = request.getReal ...

  • Rss-Rome read the XML file reader

    Core code: java implementation code: rssUrl = "http://218.206.234.34:8080/rss-xmlrpc/testRss/test.xml"; / / RssUrl where the definition of xml web address is a property, there are set-get methods URL url = new URL (getRssUrl ()); / / New UR ...

  • Rss, Atom XML file parsing aggregate specification (Rome, rssutils)

    1. Through the Rome of the two plug-ins to simplify the analytical difficulty of specification file! Rss, Atom general use on the site subscription, you can share network resources, users can browse through the client software directly to the major s

  • [Android] of Sax parsing Rss xml file, encountered an error not well-formed

    As the sax is a trigger-style parsing xml stream systems in handheld devices, has widespread applications. Android applications in development, naturally tend to choose a sax to parse the xml. Doing a rss applications, need to resolve baidu.com the rss fi

  • Introduction to Fine Solutions XML file format definition of the DTD (XML DTD)

    Introduction to Fine Solutions XML file format definition of the DTD (XML DTD) collection of DTD can be considered as one or more XML files of templates, the XML file elements, element attributes, element of the arrangement / sequence element can contain

  • Android coding xml file parsing gbk.gb2312

    Parse xml file Android supports three ways, dom, sax, pull, I use a sax more resolution, but found only the resolution sax default utf-8 encoded xml file; Through online search and finally found the solution: 1. Is to first determine the URL resource xml

  • perl read and write xml file

    Such as the title. 1, ado, be given first reading of the xml file, the file name: channel_list.xml. <?xml version="1.0" encoding="gb2312"?> <rss version="2.0"> <channel> <title> Haha g</title> <description/> </channe

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries