7.5. RSSReally Simple Syndication, or RSS, is a dialect of XML that is commonly used for providing news-related content. Things such as news headlines are the realm of RSS. The only issue is that because RSS is XML, it doesn't appear as pretty as HTML does in a web browser. Consider the RSS shown in Listing 7-4 as an example. Listing 7-4. RSS Example
Not very pretty, is it? There are, however, ways to prettify it. (Wow, who would have thought that prettify was a word? Oops, off the subject matter.) Using JavaScript and the DOM methods and properties, it is possible to extract only the headlines from the RSS shown. For example, the getElementsByTagname or the getNamedItem properties could be used to obtain the title elements. The content of these elements could then be displayed on the page as a hyperlink. Clicking on the link could then fire a JavaScript handler that would display the description element. The purpose of this side trip into the wonderful world of Really Simple Syndication was to merely show some of the possibilities of XML. When information is available as XML, it can at times be treated as something like a database. In essence, XML is not only the data itself, but also the source of subsets of that data. |