How to write an RSS feed with Java? -


i'm using java, , need generate simple, standards-compliant rss feed. how can go this?

i recommend using rome:

// feed header syndfeed feed = new syndfeedimpl(); feed.setfeedtype("rss_2.0"); feed.settitle("sample feed"); feed.setlink("http://example.com/");  // feed entries list entries = new arraylist(); feed.setentries(entries);  syndentry entry = new syndentryimpl(); entry.settitle("entry #1"); entry.setlink("http://example.com/post/1"); syndcontent description = new syndcontentimpl(); description.settype("text/plain"); description.setvalue("there text in here."); entry.setdescription(description); entries.add(entry);  // write feed xml stringwriter writer = new stringwriter(); new syndfeedoutput().output(feed, writer); system.out.println(writer.tostring()); 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -