I have a problem with my rss feeds.

When I follow link to /rss.xml with Firefox it asks whether I want to open or save it. If I choose open with Firefox it says: ...\temp\rss.xml could not be opened, because an unknown error occurred. Try saving to disk and then opening the file.

When I try to open it with IE 8 it says: This feed contains code errors. Under more info it says: Invalid xml declaration.
Line: 3 Character: 3
<?xml version="1.0" encoding="utf-8"?>

There are no problems with Safari.

How could I fix this?

I'm subscribed to my feeds and receive them normally.

Comments

sedmi’s picture

Update: when I change RSS publishing settings to titles only it works fine, but if I select titles plus teasers or full text it breaks again.
Any ideas?

sedmi’s picture

Bump! Did anyone experienced similar problem with RSS feeds?

sedmi’s picture

When i save it to local and then open in firefox i get error: XML Parsing Error: XML or text declaration not at start of entity.

Two first lines of code are empty. <?xml version="1.0" encoding="utf-8"?> is on third line, so that is causing errors.

How could i fix this? Why are two first lines empty when feeds are set to teasers or full text, but if set to titles only everything is okay?

rbishop’s picture

i have same problem. displays fine in safari not firefox

i re-themed template_preprocess_views_view_rss and changed to Content-Type: application/xml
and i see i have an extra space possibly at the beginning of the xml file.
dont know where to begin to look for that

rsanan-1’s picture

Same issue here! but only with some of my sites-
On opening the xml file there is a lot of white space on top!

UPDATE - I found 2 custom modules (that we developed) that had spaces after the closing php tag (?>). Removing those took care of the problem

culturehub’s picture

How about the rest of you? Are you still seeing this issue? I have ever since I did some major upgrades (PHP, Drupal core, all modules). I'm still looking for the cause. I tried disabling all my contributed modules and themes, but no luck.

rout’s picture

i was hoping an upgrade to 6.16 would fix it, but no such luck

rout’s picture

found a space after ?> in the theme's template.php file...removed it and now the issue is resolved.

culturehub’s picture

template.php in a custom theme? I thought RSS feeds didn't go through the normal theming process?

BigTuna’s picture

Spaces at the bottom of the template.php file was also the culprit in my case. Thanks.

sarathkm’s picture

It mostly due to spaces at start of module file before <?php or template not closing the tag. To find the culprit. Mostly it is module file so...
grep -R -H '^ <?php' modules/**/*.module
This will check all module files withing your module folder ( i am a step back in my sites/all folder in my linux terminal to find culprit.)
If you find two spaces leave two space between ^ and <?php, if one space leave one.
you will get the path of file which is culprit.

If you just get the filename you can find its path via
locate -br 'culprit.module'

After correcting clear cache. :)

Regards To All