package com.ninemax.application.rss;
import com.rsslibj.elements.Channel;
public class Rdf {
public static void main(String[] args) throws Exception {
Channel channel = new Channel();
channel.setDescription("This is my sample channel.");
channel.setLink("/");
channel.setTitle("MyChannel");
channel.setImage("/", "TheChannelImage", "/foo.jpg");
channel.setTextInput("/search", "SearchTheChannelImage",
"TheChannelImage", "s");
channel.addItem("/item1", "TheFirstItemcoversdetailsonthefirstitem>",
"TheFirstItem").setDcContributor("JosephB.Ottinger");
channel.addItem("/item2", "TheSecondItemcoversdetailsontheseconditem",
"TheSecondItem").setDcCreator("JasonBell");
System.out.println("The feed in RDF:" + channel.getFeed("rdf"));
}
}
输出:
The feed in RDF:
This is my sample channel.
MyChannel/
TheChannelImage/
/foo.jpg
TheChannelImage/search
SearchTheChannelImage
s
TheFirstItem/item1
TheFirstItemcoversdetailsonthefirstitem>
JosephB.Ottinger
TheSecondItem/item2
TheSecondItemcoversdetailsontheseconditem
JasonBell