1777 Posts in 499 Topics by 534 members
Blog Module
SilverStripe Forums » Blog Module » rss feed code error...
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 3045 Views |
-
rss feed code error...

6 February 2009 at 4:41pm Last edited: 6 February 2009 4:53pm
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: 0Does anyone have an idea of how to fix this?
Thank you for your time.
-
Re: rss feed code error...

10 February 2009 at 7:25am
view the source and check whether you get anything there, then save that as a XML file and open it and see.
-
Re: rss feed code error...

11 December 2009 at 11:33am
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 : http://www.arena-snowparks.com/news/rss
it has three lines of white space above the xml declaration.
Does any one have any ideas to fix that?
-
Re: rss feed code error...

11 December 2009 at 8:08pm
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.
-
Re: rss feed code error...

19 January 2010 at 3:57pm
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.
cheers
bruce -
Re: rss feed code error...

17 June 2010 at 12:51am Last edited: 17 June 2010 12:54am
Thanks Bruce B,
Your solution is working. I removed xml version="1.0" from RSSFeed.ss and now it is working
-
Re: rss feed code error...

29 July 2010 at 5:21am
Bruce, you're a lifesaver, been banging my head against the wall for far to long when I stumbled across your solution, cheers
-
Re: rss feed code error...

27 May 2011 at 3:47am Last edited: 27 May 2011 7:36am
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.
http://www.w3.org/TR/2008/REC-xml-20081126/#sec-prolog-dtd
"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 ?>
| 3045 Views | ||
|
Page:
1
|
Go to Top |




