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

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

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

unit testing - How to mock PreferenceManager in Android? -