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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Blog RSS XML Problem


Go to End


3 Posts   2847 Views

Avatar
Garrett

Community Member, 245 Posts

1 October 2009 at 8:43am

Hi,

I've found quite a few threads on this topic but none of them have solved my issue so I'm starting a new one. I am getting the following error when I click on my Blog RSS feed (www.mysite.com/blog/rss):

XML Parsing Error: XML or text declaration not at start of entity

Everyone in the forum is saying this is because there is white space before my <?xml?> declaration-- and they're right-- there are about 4 lines of empty space at the top of the document. The problem is, I just can NOT figure out how to fix it. There are no spaces before any of my PHP tags, site- and CMS-wide, and I have removed all the closing ?> php tags from all my class files, and I am still getting the error (in FireFox and IE; Safari is fine because it converts it to HTML before displaying it).

I tried putting a trim() around practically every return or echo statement in RSSFeed.php, but to no avail. And I even tried creating a whole new BlogHolder and added a few dummy posts just to see if it was something in the actual content of the posts-- but same error. Could there actually be something wrong with the Blog module? I just don't see where anything is being output prior to OutputToBrowser(), and I don't understand the code well enough to manipulate it.

Any help or advice would be greatly appreciated. It's driving me NUTS. I've implemented Silverstripe blogs on many occasions and have not seen this.

Thanks in advance,
Garrett

Avatar
Garrett

Community Member, 245 Posts

3 October 2009 at 4:29am

Can someone please help me with this? I even instaleld a new instance of the Blog module and there is still white space / line breaks being added before the <?xml?> declaration, which causes the RSSFeed to be invalid.

Avatar
Chip Designs

Community Member, 15 Posts

25 March 2010 at 5:21pm

Hi there,
I had a similar problem with the blog module, which is now fixed!
After checking my entire site for white spaces, I finally found the white space that was causing the issue. The page was a custom page I made for the site, in my case it was called HomePage.php found @ mysite/code/HomePage.php. So if you have any custom pages, be sure to delete the white space aftert the bottom (?>) and before the top (<?php ) of the page. Hope this helps.

Cheers,
Rob