This will (Web hosting reseller) pass the feed data generated by

This will pass the feed data generated by Rss2Create into a file. 3. Now type the following: javac -classpath . Rss2Read.java This will compile the RSS file reading class along with the Relaxer-generated classes. 4. Now run this: java -classpath . Rss2Read test.xml In the console you should now see the following: C:relaxerbin>java -classpath . Rss2Read test.xml A Demo Channel One Item How It Works Like Rss2Create.java, all the operating code is contained in the main method. It begins like this: public class Rss2Read { public static void main(String[] args) { try { Errors might occur while reading from file so the entire code is contained in a try…catch block. The first argument from the command line (args[0]) is used in the creation of an Rss class. This constructor, in the Relaxer-generated class, looks after reading the RSS data in from file and building an Rss object from it. Once created, the channel can be accessed from the Rss object, and from the channel its title can be read: Rss rss = new Rss(args[0]); Channel channel = rss.getChannel(); String title = channel.getTitle(); System.out.println(title); The items contained in the data loaded from file can be accessed using the getItem method. This returns an array of the individual items. Here each item in the array is accessed in turn and its title obtained. The title string is then printed to the console: Item[] items = channel.getItem(); for(int i=0;iGo visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

Leave a Reply