Accepting selected projects for Q2 2024 Check availability →
SERVER 02SYSTEM ONLINELAST SYNC: 03:17:44RSS 2.0 — ONLINE
HALF ASSEDTECHNICAL NOTES_
EST. 1999ISSUE 04.2BEST VIEWED AT 1024 × 768
TECHNICAL NOTES / TECHNICAL NOTES / SYNDICATION / RECORD dee41e
[SYNDICATION]NOTE

Publishing a small RSS 2.0 news feed

POSTED: 18.08.2005AUTHOR: ADMIN2 MIN READCOMMENTS: 0

Generate the feed from the same published records used by the news page. Keep draft items out and choose a stable address for the feed itself, since readers will subscribe to that address rather than repeatedly discover it.

Build the channel and item records

Use an rss root with version="2.0" and a channel containing title, link and description. Give each item a meaningful title or description, an absolute link to its article and a stable guid. If the guid is an internal identifier rather than a URL, set isPermaLink="false". Do not create a new identifier every time the feed is rebuilt.

Write XML rather than concatenating fragments

Escape ampersands and angle brackets in text and URLs. If a description contains HTML, that markup must itself be represented safely inside the XML. Declare UTF-8 and actually emit UTF-8 bytes. A stray warning message or character before the XML declaration can make the feed unreadable, so keep application diagnostics out of the response.

Check dates and reader behaviour

RSS pubDate uses an RFC 822-style date, including a timezone, rather than the date format printed on the website. Use the article’s publication time and keep it stable across routine rebuilds. Validate the XML and subscribe in more than one reader. Test a corrected headline, a new item, an empty feed and a description containing an ampersand.

PUBLISHING CHECK

Ensure the feed response has an appropriate XML content type. Check the public URL after deployment; a valid file on disk can still be served through an error page or login screen.

References

RSS 2.0 specification, July 2003 revision

W3C: XML 1.0, third edition, February 2004