Transforming RSS into HTML and WAP I (1/2) - exploring XML
Transforming RSS into HTML and WAP I
Having examined XSL, WAP and RSS in great detail in past columns, it is time to combine all that knowledge into a useful application: rendering RSS channels in various formats with the help of XSL style sheets. Three acronyms in the headline alone might not look like easy reading, but when you have read columns 1, 12, and 13 you'll be in good shape for the things ahead.
The task at hand
In the last article we learned about some good sources for news of all kinds, published in the RSS format. Some of these sites offer tools to integrate the content into your own Web site. There are various ways to accomplish this:
A Perl Script
My fellow WebReference columnist Jonathan Eisenzopf has created a Perl script for reading RSS channels in a Web server CGI and outputting them as HTML. The channelmanager is a perfect fit for CGI-driven Web sites. Due to the strict server-side solution, few client dependencies exist, as long as the HTML output is formatted for cross-browser compatibility. One challenge exists in getting the XML tools for Perl compiled for your Web server platform, since many of them, including the Perl::XML XML parser, are written in C and then bound to Perl.
A Java Applet
An alternative is to use my RSSViewerApplet to decode and display RSS channels in the client. While the applet seems to work fine across browsers by only using Java 1.0 minimal APIs, it will not work in browsers that have Java disabled. Security restrictions prevent the applet from reading RSS files from hosts other than the one it came from. This is not very helpful for displaying channels from other sites. On the upside integration in any Web site is a snap: Creating an HTML page with the right <applet> tag is all it needs!
On to servlets.
Created: Jul 18, 2000
Revised: Jul 18, 2000