| 
      
      
      From: Kaj H. <kaj...@us...> - 2003-10-01 08:04:09
      
     | 
| Hi!
Thanks for making rsslibj!
We are trying to add items by creating an item object, set attributes 
on this item and then add it to the chanal. This gives
java.lang.IllegalArgumentException: attribute rdf:resource must have data in li
on channel.getFeed("rtf").
Should it be possible to add items this way or to we have to use the 
3 arguments channel.addItem method?
Here is what we do:
// first create the chanal
Channel channel = new Channel();
channel.setDescription(selectedBlogg.strippaTittel());
channel.setLink(homepage);
channel.setTitle(selectedBlogg.strippaTittel());
if (selectedBlogg.getUrlForRSSImage() != null) {
     channel.setImage(
         homepage,
         selectedBlogg.strippaTittel(),
         selectedBlogg.getUrlForRSSImage());
}
When doing this it channel.getFeed give the rss-feed as output:
channel.addItem(
     "http://localhost/item1",
     "title item1",
     "description item1");
System.out.println("rss: " + channel.getFeed("rdf"));
When doing this:
Item item = new Item();
item.setLink("http://localhost/item1");
item.setTitle("title for first item");
item.setDescription("description for first item");
item.setDcDate(new Date());
channel.addItem(item);
System.out.println("rss: " + channel.getFeed("rdf"));
channel.getFeed gives
java.lang.IllegalArgumentException: attribute rdf:resource must have data in li
I'm using rsslibj-1_0RC2 and EXML-7.1 on osx 10.2.8 with java 1.4.1_01.
-Kaj :)
 |