XML technologies / RSS & Atom / What are newsfeeds? / Syntax: RSS as an XML format
(Excerpt from "Newsfeeds with RSS and Atom" by Heinz Wittenbrink, published by Galileo Press, 2005)
Many websites mark their feeds with an orange "XML" button. Many users and developers treat "XML" and "RSS" as synonyms. In fact, every version of RSS and Atom is an XML application. Since XML is itself a metalanguage for defining languages to exchange information on the World Wide Web, feed formats are often called "XML dialects" or "XML vocabularies". RSS remains the most successful XML vocabulary, perhaps excepting XHTML, the XML version of HTML.
XML standardisation and openness
XML’s greatest advantage for syndication is that it is a simple, open, standardised format for exchanging information on the web.
RSS spread successfully in recent years not simply because of its capabilities, but because it became a standard. It is a lowest common denominator for many kinds of updatable information and was accepted primarily as such. Millions of people using RSS to distribute and receive information enable applications that benefit from network effects and become more useful as more people use them.
This success would have been impossible without XML’s basic properties. XML is text-based: people can read its documents without too much difficulty, and their contents are easy to extract. It is not proprietary technology controlled by one vendor. RSS inherited these advantages, without which its explosive web growth would have been impossible. A binary or proprietary text format would have hindered RSS software development and limited the application market.
XML makes defining formats for specific needs easy. Every RSS format consists of a relatively small set of XML elements and attributes and rules governing their hierarchy. These rules, expressed as RELAX NG or XML Schema, can also restrict permitted element contents, such as calendar date formats.
Separating content and presentation in XML
XML separates document content from presentation. Many XML formats describe content without specifying its visual or acoustic rendering. The DocBook vocabulary for technical documentation, for example, uses an element emphasis for important passages or expressions, but does not define their printed emphasis. Other XML languages describe presentation. SVG (Scalable Vector Graphics) describes graphics, SMIL (Synchronized Multimedia Interface Language) time-structured presentations, and XSL-FO (eXtensible Style Language-Formatting Objects) can describe printed page layouts in detail.
Semantic markup
RSS is purely a content format. Its documents do not specify how to present them to users. RSS uses XML for semantic markup and exploits XML’s separation of content and presentation.
All RSS formats are pure, source-text-based content formats. They therefore require additional presentation rules adaptable to the target medium, making RSS easy to present across media and contexts.
Transformability
The simplest way to display RSS is to convert it to HTML and use an HTML browser or rendering toolkit. On the one hand, XSLT can transform XML into HTML; on the other, RSS often contains HTML fragments requiring an HTML rendering engine anyway. Like all XML documents, RSS can also be formatted directly with Cascading Stylesheets. Many other display methods exist, such as Flash.
Validatability
As XML documents, RSS feeds can be checked for format compliance using standard procedures. A Document type definition or schema file formally describes the rules enabling this check.
internationalisation
An XML document format can use standard XML techniques to address internationalisation. XML consistently specifies the character set Unicode. Unicode assigns a number to each character in every known alphabet, supporting text in any language. To represent Unicode text, characters must be encoded by mapping these numbers to bit sequences. All XML applications must support UFT-8 encoding. UTF-8 assigns one byte to the first 128 characters and two or more bytes to subsequent characters. Latin letters are encoded as in ASCII. XML applications assume UTF-8 unless the document’s initial XML declaration specifies another encoding.
When processing requires the document’s language, XML universally provides the attribute xml:lang. Newer feed formats use this facility.
Extensibility and namespaces
Extensibility is fundamental to XML, whose name means "Extensible Markup Language". Users can define new element types and attributes, unlike fixed vocabularies such as HTML. Developers of all XML versions used this property to define element types such as rss (the document or root element of an RSS document), channel and item.
Elements and attributes can no longer be freely defined once vocabularies such as RSS 1.0, RSS 2.0 and Atom are standardised for specific tasks. Rules expressed as a DTD (Document Type Definition), RELAX NG or XML Schema permit only specified elements and attributes with fixed identifiers and a defined hierarchy.
Content models may nevertheless permit elements from other vocabularies at specific positions. This is essential for feed formats, allowing XHTML sections to be embedded, for example.
A mechanism was developed to extend such documents with elements from other vocabularies, known as the namespace mechanism. All feed formats described here use it, and understanding it is necessary for productive work with these vocabularies. The page XML namespaces provides a brief introduction to namespaces.

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.