Jump to:

1851 Posts in 1606 Topics by 561 members

Blog Module

SilverStripe Forums » Blog Module » Blog RSS XML Problem

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 1978 Views
  • Garrett
    Avatar
    Community Member
    245 Posts

    Blog RSS XML Problem Link to this post

    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

  • Garrett
    Avatar
    Community Member
    245 Posts

    Re: Blog RSS XML Problem Link to this post

    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.

  • Chip Designs
    Avatar
    Community Member
    15 Posts

    Re: Blog RSS XML Problem Link to this post

    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

    1978 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.