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 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

  • Read about rome rss using a bug

    Chinese rss reading time. Need to get from the URL InputStreamReader converted into UTF-8 or the corresponding character set (). Avoid problems. Rome cached package when using the direct method to modify com.sun.syndication.fetcher.impl.HttpURLFeedFe

  • Analysis using the Rome RSS Feed

    So far, XML is very confusing aggregate specification, which makes the development of more complex aggregate services, ROME to end this situation is born. ROME is a set of Atom / RSS tools, which makes use of Java to work most of the syndication form

  • 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

  • RSS analytic tools ROME: RSS and Atom Utilities

    ROME: RSS and Atom Utilities "... ending Syndication feed confusion by supporting all of 'em." * ROME is a set of Atom / RSS Java utilities that make it easy to work in Java with most syndication formats: RSS 0.90 RSS 0.91 Netscape RSS ...

  • 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 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 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 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 ...

  • [Java] read file method Daquan

    1, read the contents of the file in bytes 2, by characters read the file contents 3, read the contents of the file by line 4, random read file contents / ** * Read the file in bytes, used to read binary files, such as pictures, audio, video and other ...

  • java read file Daquan

    1, read the contents of the file in bytes 2, by characters read the file contents 3, read the contents of the file by line 4, random read file contents public class ReadFromFile ( / ** * Read the file in bytes, used to read binary files, such as pictures,

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