CSS and RSS Newsfeed

I have to provide a newsfeed to a corporate learning management system. I have no ability to influence the CSS or structure of the management system itself, only to give it the address of my XML file to provide the newsfeed. It does display it successfully but there are two things that don’t display: the image in the <channel>

    <image>
      <title>Academy News</title>
      <link>https://test.mysite.com/portal/home.asp</link>
      <url>https://test.mysite.com/portal/images/rss_title.gif</url>
      <width>144</width>
      <height>100</height>
    </image>

… and the CSS that I’ve tried to apply. I did this by linking to a CSS file:

<?xml-stylesheet href="rss.css" type="text/xsl" media="screen"?>

(I’ve also tried linking to an absolute address)
In the CSS itself I tried defining styles like the following, just for test:

title { font-weight:bold; color: red;} 

I thought the management system’s own styles might be overriding mine but if I just paste the XML address into a browser it displays but with no styling and no ‘main’ image. Images in the individual posts do display:

<description><![CDATA[<img src="https://test.mysite.com/portal/images/saba/people.jpg" width=50 height=50>Here si a second news story with different text. Obviously.]]></description>

Can anyone point out what I’m doing wrong? This doesn’t have to display in any normal RSS readers, only in this particular system.

How are people going to view this feed? Normally you use a feed reader of some kind. I’ve not seen <image> elements in feeds like that. Normally, the whole entry—images and all—should be pulled in through the <description>, shouldn’t it?

IIRC image is an optional element on the channel – it is what you see in some readers where the feed has an icon for example.

The CMS is consuming the XML and displaying it and ignoring stuff it doesn’t care about like your channel badge and your stylesheet.

You might be able to successfully hack in your styles by embedding them in the description for each item.

Thanks. I’ll try that. Do you mean for example

<description style="font-size:1.2em;"> 

I’d assumed it probably was the system ignoring the tags I’d added but I wondered why the an ordinary browser also ignores them (for example if I paste the URL for the XML file into Internet Explorer)?

@Ralph

Thanks for replying. I tried just putting the image tag inside the description tag but it didn’t show any.

I don’t know how this system actually displays the feed; I know it doesn’t use a conventional feed reader. I don’t even have access to the system, I was just told that if I supplied the owner with an RSS XML file it would display. Which it does within the limitations I’ve described.

Nope. I mean, in your description you style the image. EG:


<description><![CDATA[<img src="https://test.mysite.com/portal/images/saba/people.jpg" style="margin:20px; float:right">Here si a second news story with different text. Obviously.]]></description>

The parser grabs the contents of the description element, it doesn’t look at attributes on the element itself.

Got you! Thanks - I’ll have a go with that.

Thanks wb_99. That worked inside the description tag. Much better.