Skip to main content
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
In my forum and blog, when I click on the RSS feed button in IE, I get a page error that says that there is a "Feed code error."
My rss widget can pick up the feed, and IE obviously detects some sort of feed. When I click on the "More Information" link in the error page, it says:
XML document must have a top level element.
Line: 0 Character: 0
Does anyone have an idea of how to fix this?
Thank you for your time.
view the source and check whether you get anything there, then save that as a XML file and open it and see.
I am having this same error it appears to be some white space that is in the top of the rss feed generated by the blog module.
Here is the link to the rss feed made by the blog module :
it has three lines of white space above the xml declaration.
Does any one have any ideas to fix that?
badjedi - you likely have some whitespace after a closing '?>' tag (might want to check the RSSFeed.ss template to make sure its just not space in there).
Usually you'll just have to go through your code files and double check the ?> is the last thing - no whitespace, no spaces. I prefer removing the whole ?> at the end as its not required and it means issues like this don't crop up.
I was having this problem and just could not find the file with the offending white space. In the end I just deleted the XML declaration line at the top of sapphire/templates/RSSFeed.ss.
After that it validated happily and everything seems to work. I'm not aware of any issues arising from deleting the XML declaration.
Thanks Bruce B,
Your solution is working. I removed xml version="1.0" from RSSFeed.ss and now it is working
Bruce, you're a lifesaver, been banging my head against the wall for far to long when I stumbled across your solution, cheers
Both Will & Bruce's solutions work, but Will's is the 'correct' one...
1) because if core code is changed, when it is upgraded, the same changes must be made again. Changes to core code need to be carefully tracked to make sure they are not lost at the next upgrade.
2) because removing the XML declaration invalidates the file format, even if your browsers/reader can cope with it.
"XML documents SHOULD begin with an XML declaration which specifies the version of XML being used."
The simplest solution is to remove ?> from the end of ALL php files.
>> ...could not find the file with the offending white space.
Just search for files under mysite containing ?>