Home. 
.

transparent

transparent

transparent

Adding HTML Formatting to RSS Feeds

Although RSS 2.0 feeds are distributed as XML files, you may have noticed more and more HTML formatting appearing in the feeds you receive. (For an example, click here to view the Altova Developer Connection Newsletter feed.)

You can add HTML to the <description> element of RSS feed items in several ways:

  • 1. Type entities in the <description> element in place of each character required for the HTML code, such as < and >, that would not be legal characters inside the XML <description> element.


  • 2. Enter the HTML code directly, but enclose the entire content of <description> in a CDATA section, indicated by <![CDATA[ at the start and ]]> at the end.


  • 3. Enter HTML directly into your description element by using the Authentic RSS Input form supplied as part of the free Altova RSS Editing Solution.


Regardless of whether you use the Authentic RSS Input form with Altova Authentic Desktop Edition or with Altova XMLSpy, the Authentic form automatically substitutes the correct entity for each character that would be illegal inside the <description> element.

Although the RSS item description is displayed in Authentic View like this:



RSS Editing Solution

The underlying content is actually this, as displayed in XMLSpy Text View:



RSS Editing Solution

One way to ensure accuracy of the HTML coding entered in your RSS XML feed is to construct and preview the code in an HTML file. XMLSpy supports HTML input with color coding, entry helpers, autocompletion, and preview in the XMLSpy Browser View.

While you are creating a new RSS item in one window, you can open a new HTML file to create and preview the HTML content. In XMLSpy Text View, your item coded as HTML might look like this:



RSS Editing Solution

You can then copy and paste the relevant portion directly into your Authentic RSS Input form, which would look like this:



RSS Editing Solution

Looking at the same RSS item in XMLSpy Text View, we see that all the required entities have been substituted automatically to create error-free content.



RSS Editing Solution

As you add HTML to your RSS feed, you should keep several caveats in mind:

  • Not all RSS feed readers render HTML within RSS feeds. This is especially likely for mobile devices. Some of your audience will see your feed with the HTML stripped out.
  • What is the goal of your feed? Is your RSS feed intended to be a rich content delivery vehicle that stands on its own, or do you want to drive more visits to your Web site? Longer and richer item descriptions in your feed could be so informative on their own that some readers may not be motivated to click through to your site.


Download a free trial of Altova XMLSpy® 2008 to try the techniques described here for yourself!



transparent
Print
Mail
Digg
delicious
.

Read the Altova Blog
Read the Altova Blog!

.

NEW Get the latest Altova announcements, learn about new product features, read tech tips and industry info at the Altova Blog. Subscribe now!

.
Acronymophobia
.

(ăk'rə-nĭmă'fōbē-ə)

Noun. Condition caused by exposure to overwhelming number of technology acronyms and buzzwords. Easily cured by the Altova Technology & Acronym Glossary.

.
.

transparent

transparent