1820 Posts in 564 Topics by 545 members
|Go to End|
1 October 2009 at 8:43am
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,
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.
25 March 2010 at 5:21pm
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.
|Go to Top|