Validate your RSS


XML Developer Tip
(Receive this column in your inbox,
click Edit your Profile to subscribe.)

Validate your RSS
Ed Tittel

I've given the XML vocabulary known as RSS, or Rich Site Summary (sometimes also known as RDF Site Summary for those with a longer view of XML trends and technologies), a fair amount of play lately. This leads me not just to recommend, but to beg interested XML developers to also make use of Mark Pilgrim's online RSS validator to make sure that the feeds they build are well-formed XML. As to the whys and wherefores of this recommendation, it's because many of the RSS readers currently available--including the majority of those I've touted in previous tips--can only parse RSS feeds that are also well-formed XML. Otherwise, it's no go for would be consumers, who instead face a range of error messages that vary from frustrating to downright cryptic.

In XML terms, well-formedness means that elements are represented using proper tags (opening and closing, where required) and proper document structure. You'll also want to make sure that your RSS feeds represent special characters (like ampersands which should appear as & using standard character entities) properly; ditto for Unicode or other special characters not found in the basic alphabetic, numeric, and punctuation sets.

Validation does more

    Requires Free Membership to View

    When you register, you'll begin receiving targeted emails from my team of award-winning writers. Our goal is to keep you informed on recent service-oriented architecture (SOA) and SOA-related topics such as integration, governance, Web services, Cloud and more.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSOA.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSOA.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

than check for syntax and proper structure; it also makes sure that XML preambles and metadata are correct and meaningful, and can check a document instance against a DTD or XML Schema to make sure that beyond being well-formed it also adheres to the rules of the XML vocabulary in use (in this case, the RSS specification itself).

Working with a validator follows what we used to call the "edit-refresh-check" cycle in the days when explaining basic validation to HTML users was pretty avant garde. These days, people are pretty used to working with such tools, so I point out only that validation should be a next-to-final step in checking and testing work any time changes are made, because edits to XML documents (especially when quick and dirty plain text tools are used) can (and sometimes do) produce just the kinds of nit-picky little errors that validators are good at catching. The notion of a cycle derives from the need to repeat edit-refresh-check activities until the validator finds nothing to complain about and recognizes your RSS document as valid and correct.

Long story short: if you're building RSS you owe it to those who consume your feeds to make sure you're providing valid XML to them. To try out this nice tool, please visit: feeds.archive.org/validator/. To read a great description of the RSS validator's inner workings by its developer, Mark Pilgrim, check www.xml.com/pub/a/2003/02/26/dive-into-xml.html. Enjoy.


About the Author

Ed Tittel is a 20-plus year veteran of the computing industry, who's worked as a programmer, manager, systems engineer, instructor, writer, trainer, and consultant. He's also the series editor of Que Certification's Exam Cram 2 and Training Guide series, and writes and teaches regularly on Web markup languages and related topics.


For More Information:

  • Looking for free research? Browse our comprehensive White Papers section by topic, author or keyword.
  • Are you tired of technospeak? The Web Services Advisor column uses plain talk and avoids the hype.
  • For insightful opinion and commentary from today's industry leaders, read our Guest Commentary columns.
  • Hey Codeheads! Start benefiting from these time-saving XML Developer Tips and .NET Developer Tips.

  • Visit our huge Best Web Links for Web Services collection for the freshest editor-selected resources.
  • Visit Ask the Experts for answers to your Web services, SOAP, WSDL, XML, .NET, Java and EAI questions.
  • Choking on the alphabet soup of industry acronyms? Visit our helpful Glossary for the latest industry lingo.
  • Couldn't attend one of our Webcasts? Don't miss out. Visit our archive to watch at your own convenience.
  • Discuss this article, voice your opinion or talk with your peers in the SearchWebServices Discussion Forums.

This was first published in July 2003

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.