I get the following error from my rss feeds:
Invalid xml declaration.
Line: 13 Character: 3
<?xml version="1.0" encoding="utf-8"?>
You can find the feed at: http://www.urbanministry.org/rss.xml
I've cleared my cache using devel, and tried disabling any modules likely to cause problems, but still no luck. I've attached the modules we use.
Any ideas on what might be causing this?
| Comment | File | Size | Author |
|---|---|---|---|
| moduleslist.txt | 5.91 KB | alsears |
Comments
Comment #1
mo6I'm also seeing this error (Drupal 5.2 / Views 5.x-1.6), it seems that there some extraneous newlines (6) are added before the xml declaration.
Comment #2
alsears commentedAny idea of how to remove the extra lines from the RSS feed? Is anyone looking into this since it looks like multiple people are having this issue?
Comment #3
mo6After further investigation it turned out not to be an error in views in our case. The extra linefeeds where introduced by a custom module which included some .php modules/files by require/include. Each file/include entered an extra linefeed on each page, generated html or rss feed. By enclosing the includes in this module in a function (which is called when needed) the extra linefeeds disappeared and the rss feeds where clean again.
Comment #4
mo6oops, %s/where/were/g
Comment #5
merlinofchaos commentedIn general, if you're including PHP code, don't put the ?> at the end -- that'll prevent errors like this. If you're including HTML code, you should use ob_start and ob_end_clean to capture the output.