Contact Jan Thomas Consulting

May 12, 2007

Displaying the image in an RSS feed

Filed under: Programming Techniques — jan @ 10:31 am

Display RSS using XSLT transformation. img tag does not display the image.

Mercury News RSS feeds include a title with an img tag:
Brokaw urges Stanford grads to live beyond computers<img src=”http://www.mercurynews.com/multimedia/mercurynews/archive/icons/photo.gif” border=”0″ alt=”(Story has photos)”>

The < and > get translated into < > so the image doesn’t get displayed.  The <img> is not read as a tag because it gets converted to ordinary text.

Here’s what I did to fix the problem:  disable-output-escaping=”yes”

The full xslt code is:
   <xsl:value-of select=”title” disable-output-escaping=”yes” />

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress