RSS (Rich Site Summary) is an XML format developed by Netscape to help propigate their "My Netscape Network".
These days it's being used as an convenient way for sites to send news feeds via XML. What RSS is in a nutshell is
an XML document containing information about the sending site and 'items' (usually news articles) that can be taken by any other site and parsed
to get timely information about that site and the content (items). If you would like more information on RSS
and it's format, check out O'Reilly Network's RSS DevCenter. Here's a handy link
to version 0.91 of the DTD: http://my.netscape.com/publish/formats/rss-0.91.dtd
This is probably the easiest function XMLCast executes, because it just takes XML from one document and puts it into another XML document, just with different
tags. Again, after our ParseXML function is done, outRSS does all the formatting . Here's the outRSS function:
outRSS function
Private Sub outRSS()
' *********************************************************
' This subroutine outputs a properly Formatted RSS XML file
' *********************************************************
Dim sHeading ' HEADING
Dim sLink ' LINK
Dim sSummary ' SUMMARY
Response.Write "" & vbCrLf
Response.Write "" & vbCrLf
Response.Write "" & vbCrLf
Response.Write "" & vbCrLf
Response.Write "Wireless Developer Network News" & vbCrLf
Response.Write "http://www.wirelessdevnet.com" & vbCrLf
Response.Write "The Wireless Developer Network is an information resource For _
developers, strategists, and managers interested in mobile computing and wireless data _
applications. Key technologies covered include Java, the Palm Computing Platform, _
Windows CE, Bluetooth, and wireless communications." & vbCrLf
'Response.Write "en" & vbCrLf
' Loop through articles
Dim i ' generic counter
For i = 1 to UBound(arArticles)
sHeading = arArticles(i).Heading
sLink = arArticles(i).Link
sSummary = arArticles(i).Summary
Response.Write "" & vbCrLf
Response.Write "" & sHeading & "" & vbCrLf
Response.Write "http://www.wirelessdevnet.com/xmlcast/xmlcast.asp?out=html&link=" _
& sLink & "" & vbCrLf
Response.Write "" & sSummary & "" & vbCrLf
Response.Write "" & vbCrLf
Next ' i
Response.Write "" & vbCrLf
Response.Write "" & vbCrLf
End Sub
Once we've pulled the data from the XML document, it's very straightforward to build the RSS document, by pulling the appropriate data (Heading, Link, etc) from our Articles classes and insert them into the appropriate RSS fields. The link is a little different, we just point to the full HTML article page.
Here's what the output in RSS looks like:
Wireless Developer Network News
http://www.wirelessdevnet.com
The Wireless Developer Network is an information resource For developers, _
strategists, and managers interested in mobile computing and wireless data _
applications. Key technologies covered include Java, the Palm Computing Platform, _
Windows CE, Bluetooth, and wireless communications.enThis is the heading for the first article
http://www.wirelessdevnet.com/xmlcast/xmlcast.asp?out=html&link=news1
This is the summary for the first article.This is the heading for the second article.
http://www.wirelessdevnet.com/xmlcast/xmlcast.asp?out=html&link=news2
This is the summary for the second article.This is the heading for the third article.
http://www.wirelessdevnet.com/xmlcast/xmlcast.asp?out=html&link=news3
This is the summary for the third article.
So, if someone requests
http://.../xmlcast.asp?out=rss
they get a nice RSS XML document that they can in turn parse and add to the content on their own site. Nice and tidy, that's the beauty of XML. But wait, you say. Isn't this the Wireless Developer Network? What about WAP?
Well, let's take a look: