- XML Reference Guide
- Overview
- What Is XML?
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Table of Contents
- The Document Object Model
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- DOM and Java
- Informit Articles and Sample Chapters
- Books and e-Books
- Implementations
- DOM and JavaScript
- Using a Repeater
- Repeaters and XML
- Repeater Resources
- DOM and .NET
- Informit Articles and Sample Chapters
- Books and e-Books
- Documentation and Downloads
- DOM and C++
- DOM and C++ Resources
- DOM and Perl
- DOM and Perl Resources
- DOM and PHP
- DOM and PHP Resources
- DOM Level 3
- DOM Level 3 Core
- DOM Level 3 Load and Save
- DOM Level 3 XPath
- DOM Level 3 Validation
- Informit Articles and Sample Chapters
- Books and e-Books
- Documentation and Implementations
- The Simple API for XML (SAX)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- SAX and Java
- Informit Articles and Sample Chapters
- Books and e-Books
- SAX and .NET
- Informit Articles and Sample Chapters
- SAX and Perl
- SAX and Perl Resources
- SAX and PHP
- SAX and PHP Resources
- Validation
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Document Type Definitions (DTDs)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XML Schemas
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- RELAX NG
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Schematron
- Official Documentation and Implementations
- Validation in Applications
- Informit Articles and Sample Chapters
- Books and e-Books
- XSL Transformations (XSLT)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XSLT in Java
- Java in XSLT Resources
- XSLT and RSS in .NET
- XSLT and RSS in .NET Resources
- XSL-FO
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XPath
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XML Base
- Informit Articles and Sample Chapters
- Official Documentation
- XHTML
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XHTML 2.0
- Documentation
- Cascading Style Sheets
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XUL
- XUL References
- XML Events
- XML Events Resources
- XML Data Binding
- Informit Articles and Sample Chapters
- Books and e-Books
- Specifications
- Implementations
- XML and Databases
- Informit Articles and Sample Chapters
- Books and e-Books
- Online Resources
- Official Documentation
- SQL Server and FOR XML
- Informit Articles and Sample Chapters
- Books and e-Books
- Documentation and Implementations
- Service Oriented Architecture
- Web Services
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Creating a Perl Web Service Client
- SOAP::Lite
- Amazon Web Services
- Creating the Movable Type Plug-in
- Perl, Amazon, and Movable Type Resources
- Apache Axis2
- REST
- REST Resources
- SOAP
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- SOAP and Java
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- WSDL
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- UDDI
- UDDI Resources
- XML-RPC
- XML-RPC in PHP
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Ajax
- Asynchronous Javascript
- Client-side XSLT
- SAJAX and PHP
- Ajax Resources
- JSON
- Ruby on Rails
- Creating Objects
- Ruby Basics: Arrays and Other Sundry Bits
- Ruby Basics: Iterators and Persistence
- Starting on the Rails
- Rails and Databases
- Rails: Ajax and Partials
- Rails Resources
- Web Services Security
- Web Services Security Resources
- SAML
- Informit Articles and Sample Chapters
- Books and e-Books
- Specification and Implementation
- XML Digital Signatures
- XML Digital Signatures Resources
- XML Key Management Services
- Resources for XML Key Management Services
- Internationalization
- Resources
- Grid Computing
- Grid Resources
- Web Services Resource Framework
- Web Services Resource Framework Resources
- WS-Addressing
- WS-Addressing Resources
- WS-Notifications
- New Languages: XML in Use
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Google Web Toolkit
- GWT Basic Interactivity
- Google Sitemaps
- Google Sitemaps Resources
- Accessibility
- Web Accessibility
- XML Accessibility
- Accessibility Resources
- The Semantic Web
- Defining a New Ontology
- OWL: Web Ontology Language
- Semantic Web Resources
- Google Base
- Microformats
- StructuredBlogging
- Live Clipboard
- WML
- XHTML-MP
- WML Resources
- Google Web Services
- Google Web Services API
- Google Web Services Resources
- The Yahoo! Web Services Interface
- Yahoo! Web Services and PHP
- Yahoo! Web Services Resources
- eBay REST API
- WordML
- WordML Part 2: Lists
- WordML Part 3: Tables
- WordML Resources
- DocBook
- Articles
- Books and e-Books
- Official Documentation and Implementations
- XML Query
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XForms
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Resource Description Framework (RDF)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Topic Maps
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation, Implementations, and Other Resources
- Rich Site Summary (RSS)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Simple Sharing Extensions (SSE)
- Atom
- Podcasting
- Podcasting Resources
- Scalable Vector Graphics (SVG)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- OPML
- OPML Resources
- Summary
- Projects
- JavaScript TimeTracker: JSON and PHP
- The Javascript Timetracker
- Refactoring to Javascript Objects
- Creating the Yahoo! Widget
- Web Mashup
- Google Maps
- Indeed Mashup
- Mashup Part 3: Putting It All Together
- Additional Resources
- Frequently Asked Questions About XML
- What's XML, and why should I use it?
- What's a well-formed document?
- What's the difference between XML and HTML?
- What's the difference between HTML and XHTML?
- Can I use XML in a browser?
- Should I use elements or attributes for my document?
- What's a namespace?
- Where can I get an XML parser?
- What's the difference between a well-formed document and a valid document?
- What's a validating parser?
- Should I use DOM or SAX for my application?
- How can I stop a SAX parser before it has parsed the entire document?
- 2005 Predictions
- 2006 Predictions
- Nick's Book Picks
There are so many different versions of and outlooks on RSS that even the very explanation of the acronym can be a subject for confusion. Depending on the version in question, RSS stands for either "RDF Site Summary" or "Rich Site Summary." In either case, it's one of the most popular uses of XML, if not the most popular, on the Internet today.
Whatever you decide it stands for, RSS is a content format that enables site owners (and other content producers) to make their information available to others via syndication. The two most common providers of syndicated content are news sites and weblogs. In either case, syndication enables one site to acquire or display headlines for another site, or an application called an aggregator to show a user what information is available for retrieval. For example, SpaceToday.net makes their daily headlines available in an XML file such as:
<?xml version="1.0"?> <!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>spacetoday.net</title> <link>http://www.spacetoday.net/</link> <description>Space news summaries and links to articles published around the web.</description> <language>en-us</language> <pubDate>Sun, 23 Mar 2003 19:51:10 GMT</pubDate> <managingEditor>jeff@spacetoday.net</managingEditor> <webMaster>jeff@spacetoday.net</webMaster> <image> <title>spacetoday.net</title> <url>http://www.spacetoday.net/images/spacetoday120x20.gif</url> <link>http://www.spacetoday.net/</link> <width>120</width> <height>20</height> <description>Space news summaries and links to articles published around the web.</description> </image> <item> <title>NASA Advisory Council expresses skepticism about OSP</title> <link>http://www.spacetoday.net/Summary/1575</link> <description>An outside committee that advises NASA said last week that they believe plans to pursue...</description> </item> <item> <title>NASA reorganizes shuttle investigation team</title> <link>http://www.spacetoday.net/Summary/1574</link> <description>NASA announced Friday afternoon that it had reorganized its internal team investigating the loss of...</description> </item> <item> <title>China: no immediate plans for Mars missions</title> <link>http://www.spacetoday.net/Summary/1573</link> <description>China's space program has no plans to carry out unmanned missions to Mars before...</description> </item> <item> <title>Boeing wins Malaysian satellite contract</title> <link>http://www.spacetoday.net/Summary/1572</link> <description>Malaysian communications satellite operator Binariang Satellite Systems Sdn. Bhd. announced Friday that it will purchase...</description> </item> <item> <title>NASA selects aurora science mission</title> <link>http://www.spacetoday.net/Summary/1571</link> <description>NASA announced Thursday that it has selected a mission to study the geomagnetic storms that...</description> </item> </channel> </rss>
Another site can retrieve that information and display it in a box on their site, as shown in Figure RSS.
Figure An RSS feed accessed by another site.
Several versions of RSS actually float around the Web, but while the concept is generally the same, they are, in fact, significantly different.
The SpaceToday.net feed above uses version 0.91, which is actually the most common version in use at the time of this writing. It consists of an rss element containing a single channel. That channel element contains information about the channel itself, and one or more items, which show up as headlines. Each item carries a title, link, and description, or blurb, that can appear on the receiving site.
The second most common version of RSS is 0.9, which is based on the Resource Definition Framework, RDF. (This is why RSS was originally known as RDF Site Summary.) The structure of an RSS 0.9 file is slightly different, in that it's based on the concept of metadata, or data about data. The same feed, using version 0.9, would look like this:
<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://my.netscape.com/rdf/simple/0.9/"> <channel> <title>spacetoday.net</title> <link>http://www.spacetoday.net/</link> <description>Space news summaries and links to articles published around the web.</description> </channel> <image> <title>spacetoday.net</title> <url>http://www.spacetoday.net/images/spacetoday120x20.gif</url> <link>http://www.spacetoday.net/</link> </image> <item> <title>NASA Advisory Council expresses skepticism about OSP</title> <link>http://www.spacetoday.net/Summary/1575</link> </item> <item> <title>NASA reorganizes shuttle investigation team</title> <link>http://www.spacetoday.net/Summary/1574</link> </item> <item> <title>China: no immediate plans for Mars missions</title> <link>http://www.spacetoday.net/Summary/1573</link> </item> <item> <title>Boeing wins Malaysian satellite contract</title> <link>http://www.spacetoday.net/Summary/1572</link> </item> <item> <title>NASA selects aurora science mission</title> <link>http://www.spacetoday.net/Summary/1571</link> </item> </rdf:RDF>
Version 1.0 of RSS is actually based on version .90, and not .91, and simply adds some optional elements and attributes. Consider, for example, the same feed in version 1.0.
<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"> <rss version="0.91"> <channel rdf:about="http://www.spacetoday.net/"> <title>spacetoday.net</title> <link>http://www.spacetoday.net/</link> <description>Space news summaries and links to articles published around the web.</description> <dc:language>en-us</dc:language> <dc:date>2003-03-23T19:51</cd:date> <dc:creator>jeff@spacetoday.net</dc:creator> <dc:publisher>jeff@spacetoday.net</dc:publisher> <items> <rdf:Seq> <rdf:li rdf:resource=" http://www.spacetoday.net/Summary/1575" /> <rdf:li rdf:resource=" http://www.spacetoday.net/Summary/1574" /> <rdf:li rdf:resource=" http://www.spacetoday.net/Summary/1573" /> <rdf:li rdf:resource=" http://www.spacetoday.net/Summary/1572" /> <rdf:li rdf:resource=" http://www.spacetoday.net/Summary/1571" /> </rdf:Seq> </channel> <image rdf:about="http://www.spacetoday.net/images/spacetoday120x20.gif"> <title>spacetoday.net</title> <url>http://www.spacetoday.net/images/spacetoday120x20.gif</url> <link>http://www.spacetoday.net/</link> </image> <item rdf:about="http://www.spacetoday.net/Summary/1575"> <title>NASA Advisory Council expresses skepticism about OSP</title> <link>http://www.spacetoday.net/Summary/1575</link> <description>An outside committee that advises NASA said last week that they believe plans to pursue...</description> </item> <item rdf:about="http://www.spacetoday.net/Summary/1574"> <title>NASA reorganizes shuttle investigation team</title> <link>http://www.spacetoday.net/Summary/1574</link> <description>NASA announced Friday afternoon that it had reorganized its internal team investigating the loss of...</description> </item> <item rdf:about="http://www.spacetoday.net/Summary/1573"> <title>China: no immediate plans for Mars missions</title> <link>http://www.spacetoday.net/Summary/1573</link> <description>China's space program has no plans to carry out unmanned missions to Mars before...</description> </item> <item rdf:about="http://www.spacetoday.net/Summary/1572"> <title>Boeing wins Malaysian satellite contract</title> <link>http://www.spacetoday.net/Summary/1572</link> <description>Malaysian communications satellite operator Binariang Satellite Systems Sdn. Bhd. announced Friday that it will purchase...</description> </item> <item rdf:about="http://www.spacetoday.net/Summary/1571"> <title>NASA selects aurora science mission</title> <link>http://www.spacetoday.net/Summary/1571</link> <description>NASA announced Thursday that it has selected a mission to study the geomagnetic storms that...</description> </item> </channel> </rss>
In this case, the RDF:about attributes provide a way to identify the resource being referenced, and the RDF:Seq links them together using this identification. The namespace using the dc: alias is referred to as the Dublin Core, a set of defined attributes for use in RDF, or Resource Definition Format, documents. The idea is that additional information can be added to the document using RDF, and because it's in a separate namespace, if the system doesn't use it, it's not a problem.
Typically, an RSS file is retrieved over HTTP, just as a web page would be, using a type of Web service. A later addition to the guide will discuss ways to accomplish this, but syndicating headlines involves simply creating the RSS file and making it retrievable.