Categories
Programming

“XML file does not appear to have any style information” when loading RSS in Firefox

Getting RSS feeds to work right; Firefox error message “This XML file does not appear to have any style information associated with it. The document tree is shown below.”

I came across an interesting thing about this particular error message in Firefox, which appears when you try to look at an RSS (or XML, I’ll get to that) feed that doesn’t work right.

The error you see in Firefox is a warning message at the top of the screen which reads:

“This XML file does not appear to have any style information associated with it. The document tree is shown below.”

You need to note that basically Firefox isn’t recognizing this as a valid RSS. There are two things you should check when debugging this problem:

1. the Content-Type response page must be set to application/rss+xml. If it is just application/xml, you’ll get this error in Firefox.

2. While all RSS is by definition XML (that is, the structure of the document returned by the server is XML), not all XML is RSS. This might be confusing to people who assume that RSS can just render any kind of XML document.

Although RSS uses XML, it requires specific elements, like the <channel> and <item> elements. See this link for the complete specification.

Your output should look something roughly like this. Note that the <title>, <link> and first <description> elements refer to the <channel> (as they are the direct descendant of the <channel>), where as the second <description> element refers to the <item>.

<?xml version=”1.0″ encoding=”UTF-8″?>
<rss version=”2.0″>
 <channel>
  <title>title for my channel</title>
  <link>http://www.example.com</link>
  <description>this description applies to my channel</description>
  <item>
   <description>description for this item</description>
  </item>
 </channel>
</rss>

Leave a Reply

OR LOG IN WITH




Your email address will not be published. Required fields are marked *