Why RSS Content Module is Popular - Including HTML Contents

RSS has long had the <description> element that can be used to include the contents of an <item>. For example, you could use it to include the entire contents of a blog post; or just a summary of it. However, the RSS <description> element is only suppose to be used to include plain text data. This obviously limits you. And since many people write in HTML information and formatting is lost with the RSS <description> element.

However, it has become common practice to put XML escaped HTML data in it. (Even through you are not suppose to.) For example, if your blog post was:

    This is <b>bold</b>.

then the <description> would be:

   <description>This is &lt;b&gt;bold&lt;/b&gt;.</description>

Note that the "<" has been turned into "&lt;". And the ">" has been turned into "&gt;". This greatly bloats the size of contents but is necessary since certain characters are no allowed in XML.

XML does however have the CDATA convention. You can put (almost) whatever you want in a CDATA section. Including "<" and ">" without having to escape them. Using the example above we'd have:

   <description><![CDATA[This is <b>bold</b>.]]></description>

This helps reduce the bloat. However, the <description> is NOT suppose to be used for any of this. It is only suppose to be used to include plain text. But RSS still leaves us without a way to include HTML contents. The RSS Content Module fills this gap.

NOTE: Do not put anything but plain text into the RSS <description> element. Although it has become common practice to abuse the RSS <description> element and put non-plain text data in it. It is not actually allowed.

An example using the most popular element of the RSS Content Module is shown below:

   <?xml version="1.0">
   
   <rss version="2.0"
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
   
       <channel>
           <title>Example</title>
           <description>An RSS Example with Slash</description>
           <lastBuildDate>Sun, 15 May 2005 13:02:08 -0500</lastBuildDate>
           <link>http://www.example.com</link>
   
           <item>
               <title>A Link in Here</title>
               <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid>
               <pubDate>Sun, 15 May 2005 13:02:08 -0500</pubDate>
               <link>http://www.example.com/blog/2005/05/15/114</link>
               <content:encoded><![CDATA[This is a <a href="http://example.com/">link</a>.]]></content:encoded>
           </item>
   
           <item>
               <title>Some Italics HTML</title>
               <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</guid>
               <pubDate>Sun, 15 May 2005 10:55:12 -0500</lastBuildDate></pubDate>
               <link>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</link>
               <content:encoded><![CDATA[This is <i>italics</i>.]]></content:encoded>
           </item>
   
           <item>
               <title>Some Bold HTML</title>
               <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/112</guid>
               <pubDate>Sun, 15 May 2005 08:14:11 -0500</lastBuildDate></pubDate>
               <link>http://www.example.com/blog/2005/05/15/112</link>
               <content:encoded><![CDATA[This is <b>bold</b>.]]></content:encoded>
           </item>
       </channel>
   
   </rss>

The <content:encoded> element is the reason that the RSS Content Module is popular. This element is used to include an HTML <description>.

NOTE: Strictly speaking, the RSS Content Module and <content:encoded> are not quite being used correctly. It requires intertwinment with RDF's XML serialization. But this is how it has become common practice to use it.

Document Tags and Contributors

Tags:
Contributors to this page: Nickolay, NickolayBot, Charles, peeja, Sheppy
Last updated by: Sheppy,