Freigeben über


Windows RSS Publisher's Guide (work-in-progress)

Last updated: May 27, 2007

Welcome to the Windows RSS Publisher's Guide.

The goal of this page is to provide ongoing guidance to publishers on how to create web pages and feeds that work correctly with IE 7 and Windows Vista. In general, we'll simply be repeating what most people in the community already expect, so for many people already versed in RSS, there will be few surprises. However, we think that being explicit about exactly what we support never hurt anyone. This way, the community can tell us if we're doing something wrong, or we can explain why we chose one particular direction over another.

This page is a work in progress. Whenever we add something to it, we'll also post to the blog. 

 


Contents

Intro. Feed format support

I. Web pages with associated feeds (or Feed autodiscovery)

II. Mime types for feeds (or How a IE determines that a file is a feed)

III. Feed parsing

Intro - Feed format support

IE7 and the Windows RSS Platform support the following feed formats:

RSS 2.0 (https://www.rssboard.org/rss-specification)
RSS 1.0 (https://web.resource.org/rss/1.0/spec)
Atom 1.0 (https://www.ietf.org/rfc/rfc4287.txt)

Additionally, IE7 and the Windows RSS Platform support the following formats that are considered deprecated by their authors. We encourage publishers of feeds in these formats to upgrade to current feed formats.

RSS 0.91 (https://backend.userland.com/rss091)
RSS 0.92 (https://backend.userland.com/rss092)
Atom 0.3 (https://www.mnot.net/drafts/draft-nottingham-atom-format-02.html)

The following sections contain information on how to deploy these formats. See, in particular, section III for information on how feeds are parsed, including features that are not supported.

 

 

Section I - Web pages with associated feeds

This section describes what publishers should do to their web sites and web pages to make them work well with IE's feed reading support.

Feed autodiscovery

The "Feed" button in IE 7 for Windows XP and in Windows Vista is designed to "light up" when the web page the user is viewing has an associated feed.

Overview

In order to tell IE (and other browsers, for that matter), that your page has an associated feed, you need to add a link element inside the header of your web page.  This helps users discover that that the page has an associated feed to which they can subscribe.

Here is an example of RSS autodiscovery (use for both RSS 1.0 and RSS 2.0):

<html>
<head>
<link rel="alternate" type="application/rss+xml" title=" your feed title here " href=" https://www.company.com/feedurl.rss ">
</head>
<body>
...

Here is an example of Atom Autodiscovery:

<html>
<head>
<link rel="alternate" type="application/atom+xml" title=" your feed title here " href= "https://www.company.com/feedurl.xml" >
</head>
<body>
...

Put the title of your feed in the title attribute and the URL to the feed itself in the href attribute.

Now, when a user goes to your web page, the "Feed" button on the IE Command Bar will light up (and if the user chooses, a sound will play). The button has two functions: the main button that navigates to the first discovered feed and a drop-down menu that lists all of the discovered feeds.

When the user selects a feed, IE will navigate to a preview of the feed itself, which IE will render in a readable form - from there the user will be able to subscribe to your feed.

Below is an example of the "Feed" button in IE7 lighting up:

Multiple feeds

As noted above, you can have as many <link> elements in your web page as you wish. If the user clicks on the drop-down next to the feed button, IE7 will show the titles of all of them in a list, in the order you put them in the page. The user can pick any of them to navigate to that feed.

Here's an example of selecting the menu button:

Best Practices

The following is a collection of best practices (do's and don'ts) for how to leverage RSS autodiscovery in your web pages.

DO choose good titles

As you can see in the example above, IE will display the title as you write it in your page. Therefore, it's a good idea to actually put the title of the feed right there. Don't, for example, put "RSS" in your title since this isn't very informative to a user.

DON'T list the same feed in different formats

Unless you have a really good reason, it's not a good idea to have two links (or three!) that provide the same feed in different formats. It just makes the user have to pick between two things that they are not capable of distinguishing between. Pick your favorite format, and just support that.

DO put your most relevant feed first

You are always welcome to put as many feeds as you want in your header, but you should make sure that the one at the top is the one that's most relevant to the page itself.   In IE7, we have optimized for the most common scenario of having a single feed by making the first (or only) feed in the list one-click away.  Getting to that first (or only) feed in the list will be one-click away. Getting to the others will be two more clicks away.

DO continue providing links to your feed(s) in your web page

There's no harm in continuing to provide ordinary to your feeds in the web page. In many cases, you can provide a more descriptive text than you can fit in the link element. Whether the user clicks on the "Feeds" button or on one of those links, IE will recognize that's it is a feed and display it properly.

Additionally, in some cases -- for example, sites with lots of feeds -- it's probably best to simply provide links to those in a list on the page instead of putting two dozen feeds in the header.

References

Mark Pilgrim's post on feed autodiscovery: https://diveintomark.org/archives/2002/06/02/important_change_to_the_link_tag

Atom Autodiscovery Internet draft:
https://philringnalda.com/rfc/draft-ietf-atompub-autodiscovery-01.html

Section II - MIME types for feeds

When a user navigates to a feed, IE7 displays a feed reading view to the user. This section explains how IE detects if a file is a feed. Use the recommendations below to ensure that your feed is detected correctly by IE7.

If the user browses to a feed though the feed discovery button on the Command Bar, IE7 assumes it is a feed and applies the feed reading view.

When a user clicks on a link in a page, IE7 applies the following process to determine whether to use display the file using the feed preview.

  1. IE checks the HTTP Content-Type header provided by the web server. If the HTTP Content-Type header of the file indicates that it is for an application that can handle feeds, IE applies its feed preview on the feed file.
  2. Some content types are generic XML or RDF content-types which may be feed files. In the case, IE will scan the first 512 bytes looking for common identifiers of feeds. If these identifiers are found, IE will apply its feed preview.

The specific Content-Types to use vary based on the feed format. There are multiple feed formats that IE7 supports: RSS 2.0 (0.91 and 0.92 included), Atom 1.0, and RSS 1.0.

RSS 2.0

When using an RSS 2.0, 0.91, or 0.92 feed, the HTTP Content-Type header should be “text/xml”:

   Content-Type: text/xml

Because this is a generic content-type, IE7 will scan the first 512 bytes to look for the “<rss” string that indicates that it is a feed. If the string is found, the file is considered a feed, and the feed preview is shown to the user.

For example, this is a RSS 2.0 feed for the IE blog, and IE7 determines that it is a feed because of the highlighted string. 

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" … >

The encoding should be specified in BOM and the XML prolog to ensure that the document is parsed by applications correctly. 

Alternatively, for RSS 2.0 and 1.0 files, IE7 also supports:

   Content-Type: application/rss+xml

In this case, IE7 does not scan the document before applying the feed reading view. 

Note: UTF-16 encoded feeds are not scanned and should use the Content-Type “application/rss+xml” in order for IE7 to detect that it is a feed.

Atom 1.0

Atom 1.0 (and 0.3) feeds should use the HTTP Content-Type header “application/atom+xml” to indicate that it is a feed:

   Content-Type: application/atom+xml

IE7 does not read the document when this Content-Type is specified.  The feed reading view is automatically applied to the feed.

IE7 also supports the Content-Type “text/xml” for Atom feeds:

   Content-Type: text/xml

Similar to RSS 2.0, when IE encounters this Content-Type, the first 512 bytes of the document are read for the string “<feed”:

<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="https://www.w3.org/2005/Atom" … >

RSS 1.0

IE7 detects a RSS 1.0 feed using the content types “application/xml” or “text/xml”:

   Content-Type: application/xml

The document is checked for the strings "<rdf:RDF", "https://www.w3.org/1999/02/22-rdf-syntax-ns#" and "https://purl.org/rss/1.0/".  IE7 detects that it is a feed if all three strings are found within the first 512 bytes of the document.

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="https://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="https://purl.org/rss/1.0/" … >

IE7 does not support Content-Type “application/rdf+xml” because there are many RDF files that are not related to feeds.  This prevents IE7 from handling RDF files that are meant for other applications.

In all cases, IE7 also supports other generic Content-Types (ex: “application/xml”) by checking the document for specific Atom and RSS strings, but this is done to detect as many feeds as possible. This is not recommended that you rely on this detection for your feed. Follow the recommendations above to make sure that your feeds is always correctly detected by IE.

Section III - Feed parsing

IE7 supports the following feed formats: RSS 2.0 (0.91 and 0.92 included), Atom 1.0, and RSS 1.0.  Section II above explains the detection of these feed formats. Once a feed is detected properly, the feed is passed to the RSS Platform for sanitization and normalization.  After this process, the IE feed reading view displays the feed for the user to read.

Feeds that reference a DTD are not supported by the RSS Platform.  A DTD is used to help XML parsers with validation of the document.  However, DTD validation is a potential source of security issues for XML parsers, and validation is not required for feeds to work correctly in aggregators.  To read more about potential security issues with DTDs, please read this MSDN article.

To limit the impact that feeds with DTDs can have on a user’s computer, the RSS Platform’s parser rejects all feeds that contain references to DTDs and IE7 displays an error instead of showing the feed reading view. To enable the feed to be supported in the RSS Platform and viewable in IE7, the reference to the DTD needs to be removed.
Example of a feed with a DTD reference (not supported):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rss SYSTEM "https://my.netscape.com/publish/formats/rss-0.91.dtd">
<rss>

Feed with no DTD reference:

<?xml version="1.0" encoding="UTF-8"?>
<rss>

By removing the DTD reference, the feed can be processed by the RSS Platform and displayed to the user in the feed reading view.

Work in Progress -- more sections to be added as questions are asked by publishers.