Re: [Informa-developer] Looking for Examples for Creating/Appending to a Channel
Status: Beta
Brought to you by:
niko_schmuck
From: Niko S. <nik...@ha...> - 2004-06-16 16:10:05
|
Hi Jerald, sorry for the late answer, I was offline for some days. >What is the best way to append to an existing RSS/RDF file? Currently I'm >reading in the file with RSSParser.parse() into a channel, adding to the= >channel and then writing the channel back out using RSS_1_0_Exporter.wri= te(). Your proposed code looks fine to me. I would be very interested to hear if this has worked for you and if you have any ideas if we should improve= on this when it comes to the Informa API? >{ > .... > File channelFile =3D new File(channelFilename); > ChannelIF channel =3D RSSParser.parse(new ChannelBuilder(), channelFil= e ); > ItemIF item1 =3D new de.nava.informa.impl.basic.Item(channel, itemTitl= e, > itemDescription, itemURL); > channel.addItem(item1); > RSS_1_0_Exporter rssFile_1_0 =3D new RSS_1_0_Exporter(channelFile)); you might to want to just use ChannelExporterIF as object type, but that is just a small issue ... > rssFile_1_0.write(channel); > ..... >} Greetings, Niko |