Finally, for demonstration purposes a text representation of (Web hosting)

Finally, for demonstration purposes a text representation of the feed is generated and printed to the console. In practice this would usually be passed over a HTTP connection. The Rss class has a convenience method for getting the text, makeTextDocument: System.out.println(rss.makeTextDocument()); } catch (Exception e) { e.printStackTrace(); } } } Reading a Feed Reading a feed using the Relaxer-generated classes is no less straightforward. The following code is a little command-line application that will take a feed file name as an argument then print the title of the feed followed by the title of any items found in that feed: /* * RSS 2.0 Feed Title Reader * uses Relaxer-generated classes */ public class Rss2Read { public static void main(String[] args) { try { Rss rss = new Rss(args[0]); Channel channel = rss.getChannel(); String title = channel.getTitle(); System.out.println(title); Item[] items = channel.getItem(); for(int i=0;i test.xml 264 Chapter 20
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Leave a Reply