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.

分类:Web 时间:2008-12-22 人气:333
本文关键词:
分享到:
blog comments powered by Disqus

相关文章

  • Rss, Atom XML file parsing aggregate specification (Rome, rssutils) 2011-01-11

    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 2010-09-12

    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 r

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

    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 2010-03-10

    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 2010-03-10

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

  • Introduction to Fine Solutions XML file format definition of the DTD (XML DTD) 2010-05-10

    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 con

  • Rss-Rome reader reads the XML file 2010-10-09

    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 defi

  • Android coding xml file parsing gbk.gb2312 2010-12-12

    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

  • perl read and write xml file 2011-05-05

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

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.138 (s). 12 q(s)