I want to create an RSS feed using a JAVA application (using ROME), and got it to work OK, till i decided to use some categories. I use this code for the categories
public boolean addRss(String cat,String msg,String msgLink,Date date){
SyndFeed feed = new SyndFeedImpl();
List<SyndEntry> entries = new ArrayList<SyndEntry>();
SyndEntry entry;
entry = new SyndEntryImpl();
entry.setTitle(msg);
if(msgLink!=null){
entry.setLink(msgLink);
}
List<SyndCategory> categories = new ArrayList<SyndCategory>();
if(cat!=null){
SyndCategory category;
category = new SyndCategoryImpl();
category.setName(cat);
categories.add(category);
entry.setCategories(categories);
categories.remove(category);
entries.add(entry);
}
entry.setPublishedDate(date);
entries.add(entry);
feed.setEntries(entries);
return true;
}
but this doesnt include any category tag on the output xml file. any ideas? thanks
Edit
It seems that using the same piece of code on the creation of the RSS (and not the creation of the Item, as i did before) it does work. I can now add a category tag on the RSS file, but it implies for the whole of the rss feed, i.e for all the items that follows. so i cant create an rss feed that has items from multiple categories