Rome基本介绍
来源:互联网 发布:pc离线翻译软件 编辑:程序博客网 时间:2024/05/18 00:50
- RSS 0.91 Netscape
- RSS 0.91 Userland
- RSS 0.92
- RSS 0.93
- RSS 0.94
- RSS 1.0
- RSS 2.0
- Atom 0.3
- Atom 1.0
等标准。你也可以自己扩展他的Module,让他解析你自己定义的XML格式。可以说它是一种用途很广的框架,在使用它之前。你必须下载JDOM开发包,因为它是用JDOM解析XML的。
在Rome中主要包裹下面几个包
com.sun.syndication.feed
com.sun.syndication.feed.atom
与获得atom中各个节点的数据
com.sun.syndication.feed.module
modeule为各个数据模型层。可以自己扩展
com.sun.syndication.feed.rss
用与获得RSS中各个相对应的XML节点中的值
com.sun.syndication.feed.sse
com.sun.syndication.feed.synd
此包为写成RSS格式的XML设置个节点的属性
com.sun.syndication.io
此包为输入输出流。
它的UML图
图1
boolean ok = false;
if (args.length==2) {
try {
String feedType = args[0];
String fileName = args[1];
feed.setFeedType(feedType); //设置rss版本
feed.setLink(http://www.csdn.net); //<link>
feed.setDescription("This feed has been created using Rome (Java syndication utilities");
SyndEntry entry;
SyndContent description;
entry.setTitle("Rome v1.0");
entry.setLink(http://www.csdn.net);
entry.setPublishedDate(dateParser.parse("2004-06-08"));
description = new SyndContentImpl();
description.setType("text/plain");
description.setValue("Initial release of Rome");
entry.setDescription(description);
entries.add(entry);
entry.setTitle("Rome v2.0");
entry.setLink(http://ww.csdn.net);
entry.setPublishedDate(dateParser.parse("2004-06-16"));
description = new SyndContentImpl(); //描述
description.setType("text/xml");
description.setValue("Bug fixes, <xml>XML</xml> minor API changes and some new features");
entry.setDescription(description);
entries.add(entry);
entry.setTitle("Rome v3.0");
entry.setLink("http://www.csdn.net");
entry.setPublishedDate(dateParser.parse("2004-07-27"));
description = new SyndContentImpl();
description.setType("text/html");
description.setValue("<p>More Bug fixes, mor API changes, some new features and some Unit testing</p>"+
"<p>For details check the <a href=/"http://www.csdn.net/">Changes Log</a></p>");
entry.setDescription(description);
entries.add(entry);
SyndFeedOutput output = new SyndFeedOutput();
output.output(feed,writer); //写到文件中去
writer.close();
}
catch (Exception ex) {
ex.printStackTrace();
System.out.println("ERROR: "+ex.getMessage());
}
}
System.out.println();
System.out.println("FeedWriter creates a RSS/Atom feed and writes it to a file.");
System.out.println("The first parameter must be the syndication format for the feed");
System.out.println(" (rss_0.90, rss_0.91, rss_0.92, rss_0.93, rss_0.94, rss_1.0 rss_2.0 or atom_0.3)");
System.out.println("The second parameter must be the file name for the feed");
System.out.println();
}
}
- Rome基本介绍
- Rome使用简单说明一(基本应用)
- Rome介绍 java的RSS阅读,发布器
- rome-rss
- ROME工具
- Adobe Rome
- Rome Digit
- Fresco基本使用基本介绍
- ROME解析RSS(代码)
- ROME解析 百度 RSS
- 对Rome之我见
- Rome自动生成Rss
- Rome History(序)
- 使用Rome 生成RSS
- Rome读取RSS
- Rome to Intger
- ROME br not only
- 用Rome解析RSS
- 使用EndNote的七大理由
- 参考文献的通用样式
- 梅花凋零又冬残
- getParameter和getAttribute的区别是什么?
- rome的一个小例子,读取rss数据
- Rome基本介绍
- vfork vs fork
- Java开源RSS组件包(Java Open Source RSS Lib Packages)
- 北大2000题
- 实现rss
- 2008年11月的最后一晚
- [Linux笔记]下载软件选择篇
- 一个无聊男人的疯狂《数据结构与算法分析-C++描述》学习笔记 用C++/lua/python/bash的四重实现(6)高效率的幂运算
- ajax读rss示例