From: Jason B. <jas...@sy...> - 2003-10-01 10:09:05
|
Kaj Simple solution, the setAbout needs to be set so the <item> tag has an rdf reference in it. Add: item.setAbout("Something"); to the Item object. Item item = new Item(); item.setLink("http://localhost/item1"); item.setTitle("title for first item"); item.setDescription("description for first item"); item.setAbout("Something"); item.setAuthor("Jason Bell"); item.setDcDate(new Date()); channel.addItem(item); Then it works, look at the output rdf closely and you will see what I mean. Regards Jason Bell -----Original Message----- From: rss...@li... [mailto:rss...@li...]On Behalf Of Jason Bell Sent: 01 October 2003 11:00 To: rss...@li... Cc: Kaj Hejer Subject: RE: [Rsslibj-developer] channel.addItem(item): IllegalArgumentException Hi Kaj I have to admit that I use the first method for adding items and have not tried to add items on a per object basis. I have replicated the error though and will look into it. When I have some answers I will post them on this list. Kind regards and thanks Jason Bell -----Original Message----- From: rss...@li... [mailto:rss...@li...]On Behalf Of Kaj Hejer Sent: 01 October 2003 09:04 To: rss...@li... Subject: [Rsslibj-developer] channel.addItem(item): IllegalArgumentException 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 :) ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Rsslibj-developer mailing list Rss...@li... https://lists.sourceforge.net/lists/listinfo/rsslibj-developer ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Rsslibj-developer mailing list Rss...@li... https://lists.sourceforge.net/lists/listinfo/rsslibj-developer |