Proceed to WirelessDevNet Home Page
Publications, e-books, and more! Community Tutorials Store Downloads, tools, & Freebies! IT Career Center News Home
newnav.gif

Newsletters
EMail Address:



   Content
  - Articles
  - Columns
  - Training
  - Library
  - Glossary
 
   Career Center
  - Career Center Home
  - View Jobs
  - Post A Job
  - Resumes/CVs
  - Resource Center
 
   Marketplace
  - Marketplace Home
  - Software Products
  - Wireless Market Data
  - Technical Books
 
   News
  - Daily News
  - Submit News
  - Events Calendar
  - Unsubscribe
  - Delivery Options
 
   Community
  - Discussion Boards
  - Mailing List
  - Mailing List Archives
 
   About Us
  - About WirelessDevNet
  - Wireless Source Disks
  - Partners
  - About MindSites Group
  - Advertising Information
 
INDEX
>XMLCast Introduction
>Parsing the XML
>Output as [simple]HTML
>Output as RSS
>Output as WML

Content Management and Distribution Using XML

Output as RSS

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 "<?xml version=""1.0""?>" & vbCrLf Response.Write "<!DOCTYPE rss PUBLIC ""-//Netscape Communications//DTD RSS 0.91//EN" & chr(34) & vbCrLF Response.Write chr(34) & "http://my.netscape.com/publish/formats/rss-0.91.dtd"">" & vbCrLf Response.Write "<rss version=""0.91"">" & vbCrLf Response.Write "<channel>" & vbCrLf Response.Write "<title>Wireless Developer Network News</title>" & vbCrLf Response.Write "<link>http://www.wirelessdevnet.com</link>" & vbCrLf Response.Write "<description>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.</description>" & vbCrLf 'Response.Write "<language>en</language>" & 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 "<item>" & vbCrLf Response.Write "<title>" & sHeading & "</title>" & vbCrLf Response.Write "<link>http://www.wirelessdevnet.com/xmlcast/xmlcast.asp?out=html&link=" _ & sLink & "</link>" & vbCrLf Response.Write "<description>" & sSummary & "</description>" & vbCrLf Response.Write "</item>" & vbCrLf Next ' i Response.Write "</channel>" & vbCrLf Response.Write "</rss>" & 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: <?xml version='1.0' encoding='ISO-8859-1'?> <!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/Formats/rss-0.91.dtd"> <rss version="0.91"> <channel> <title>Wireless Developer Network News</title> <link>http://www.wirelessdevnet.com</link> <description>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.</description> <language>en</language> <item> <title>This is the heading for the first article</title> <link>http://www.wirelessdevnet.com/xmlcast/xmlcast.asp?out=html&link=news1</link> <description>This is the summary for the first article.</description> </item> <item> <title>This is the heading for the second article.</title> <link>http://www.wirelessdevnet.com/xmlcast/xmlcast.asp?out=html&link=news2</link> <description>This is the summary for the second article.</description> </item> <item> <title>This is the heading for the third article.</title> <link>http://www.wirelessdevnet.com/xmlcast/xmlcast.asp?out=html&link=news3</link> <description>This is the summary for the third article.</description> </item> </channel> </rss> 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:

Next: Output as WML
Sponsors

Search

Eliminate irrelevant hits with our industry-specific search engine!









Wireless Developer Network - A MindSites Group Trade Community
Copyright© 2000-2010 MindSites Group / Privacy Policy
Send Comments to:
feedback@wirelessdevnet.com