Forums

No RSS - XML parsing error (18 posts)

  1. GaryWhite855
    Member
    Posted 5 months ago #

    Clicked on my feed link and I got the following error
    =======
    XML Parsing Error: XML or text declaration not at start of entity
    Location: http://www.running-contacts.com/rcblog/feed/
    Line Number 2, Column 1:

    <?xml version="1.0" encoding="UTF-8"?>
    ^
    =========
    Did view source and <?xml etc is the second line first line is blank

    Feed was fine previously
    Where should I begin to try to solve this?

    WP 2.7.1

    Thanks for any assistance

  2. esmi
    Member
    Posted 5 months ago #

    Check through all files looking and remove any blank lines at the top or bottom.

  3. GaryWhite855
    Member
    Posted 5 months ago #

    Thanks,

    I have checked the Theme files header.php functions.php etc and removed blank line top and bottom but no change.

    I'll look at posts and pages next. Anywhere else?

    When I view page source the first section is:
    ____________________________

    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0"
    	xmlns:content="http://purl.org/rss/1.0/modules/content/"
    	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    	xmlns:dc="http://purl.org/dc/elements/1.1/"
    	xmlns:atom="http://www.w3.org/2005/Atom"
    	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    	>

    ______________________
    First line being blank

    Gary

  4. GaryWhite855
    Member
    Posted 5 months ago #

    I have removed blank lines from post & pages and from all of the xxx.php files in the Appearance editor.

    It is the Amazing Grace Theme if that has any relevance.

    There is still a blank line as the first line of the RSS feed and I get the following error message

    XML Parsing Error: XML or text declaration not at start of entity
    Location: http://www.running-contacts.com/rcblog/feed/
    Line Number 2, Column 1:<?xml version="1.0" encoding="UTF-8"?>
    ^
  5. GaryWhite855
    Member
    Posted 5 months ago #

    I have looked at all my xxxx.php files for white space and I have used the plugin here that is often recommended on this forum
    http://wordpress.org/extend/plugins/fix-rss-feed/

    The plugin found and reportedly fixed the white space problems - running it a second time found no errors.

    I deactivated all of my plugins and still get the error.

    What should I try next? Most of the posts on this forum indicate white space as the usual culpprit. Is there another way to check for it?

    Thanks

  6. esmi
    Member
    Posted 5 months ago #

    Have you checked your wp-config.php file? wp-blog-header.php is another file possibility.

  7. GaryWhite855
    Member
    Posted 5 months ago #

    Yes Both. The fix-rss-feed plugin said that it found white space in a bunch of files and removed it. I re-ran it and it found none.

    I tried switching to the WP default theme and had the same error (No plugins and default theme)

    I think I'll try to do the upgrade to 2.8 and see if that helps. Don't know what else to try.

  8. esmi
    Member
    Posted 5 months ago #

    I tried switching to the WP default theme and had the same error (No plugins and default theme)

    It's got to be in a core file then. Try re-uploading fresh copies of the wp-admin and wp-includes folders plus all files in the WP root folder.

  9. GaryWhite855
    Member
    Posted 5 months ago #

    I got it fixed.

    I used this

    http://wejn.org/stuff/wejnswpwhitespacefix.php.html

    Alternatively this may work for some:

    http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/

    Thanks to all who helped out.

    Gary

  10. esmi
    Member
    Posted 5 months ago #

    Just out of curiosity, where was the whitespace?

  11. GaryWhite855
    Member
    Posted 5 months ago #

    I never found it. That is I found some and corrected them to no avail.

    This plugin:
    http://wordpress.org/extend/plugins/fix-rss-feed/
    (that checks) said there were none - after it fixed them - but it still didn't work.

    What worked for me:
    http://wejn.org/stuff/wejnswpwhitespacefix.php.html
    seems to strip out white space? You could probably tell by looking at it (it's a small bit of code). So it might still be being generated and then removed.

    There is always a possibility that there was a cache issue also. I was clearing the cache (firefox/tools/privacy/etc) and trying other browsers but who knows?

    I did fix a typo in the blog before I saw results, so maybe the RSS needed to regenerate in some way? I'm still pretty new to wordpress - <2-months so...

    Thanks for the help, hope this exchange helps someone else too.

  12. GaryWhite855
    Member
    Posted 5 months ago #

    I see I missed your post about re-uploading fresh copies of the wp-admin and wp-includes folders plus all files in the WP root folder. We posted at nearly the same time. So for the record that didn't get tried.

    I did upgrade to 2.8 thinking that would give fresh versions of some files but it didn't solve the issue - unless a cache issue was at play.

  13. JohnP
    Member
    Posted 4 months ago #

    This quick fix worked for me

    Added this line to .htaccess:

    AddType x-mapp-php5 .php

    Long version - I had this problem on a fresh 2.8 install, default theme, no plugins - tried replacing all core files and checked all the likely suspects for whitespaces.

    So I tried installing wejnswpwhitespacefix.php and in the process used this line in my .htaccess to force php5:
    AddHandler application/x-httpd-php5 .php

    This fixed the error, but both feeds were now blank. I unistalled Wejn's script, and the feed was still blank, so I tried the alternative php5 switch, and found everything was working sweet!

  14. tar.gz
    Member
    Posted 3 months ago #

    I'm bumping into the same error.

    I hunted for blank lines in my theme's php files, but no result.

    The strange thing is that those two feeds:
    /feed/atom/
    /feed/rss/
    are working fine, the error occurs only in the following:
    http://ms-studio.net/feed/

    As i don't want to do any patches that will be overriden by the next WP update, i'm leaving it as is... but if someone wants to investigate i'm ready to testify.

  15. danieljenkinsphoto
    Member
    Posted 2 months ago #

    I've been fighting this problem all day, and luckily found it inside of one of my plugins wp-print. The issue is trailing line feeds after the ?> tag or space or linefeed before the <?php

    In a few of the files in the plugin folder for wp-print, it seemed the php files were double spaced, so i removed the extra spaces and voila!

  16. dwheeler
    Member
    Posted 2 months ago #

    I had the same problem and found it in plugin.

    If it used to work before, try disabling the plugins one at a time.

  17. jazbek
    Member
    Posted 2 months ago #

    I had no problem viewing my RSS feed when I was developing locally, but once I copied all the files to my webserver I was getting this error. When I viewed source of my /feed/ URL, I could see there was a line break before the XML declaration at the top of the file.

    Since the exact same files were working on my localhost installation, I knew it wasn't due to any plugins or trailing whitespace at the end of any of my files because that would have caused an issue on my local copy as well.

    Somehow I was able to fix the problem by opening wp-includes/feed-rss2.php, making a change in the file, saving it, uploading it, undoing the change (so it was exactly the same as before), and then uploading again. No clue why that fixed it, but it did.. there's no longer a blank line being output at the beginning of the XML file.

    HTH someone..

  18. letsnurture
    Member
    Posted 3 weeks ago #

    Hi folk,

    This problem occurs because of the leading space before xml content.

    I faced the same problem and then i found the solution at
    http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/

    And it works pretty well for me.

    Hope, it could be helpful to someone!!!!!!!!

    Regards,
    http://www.google.com/profiles/sachinpethani

Reply

You must log in to post.

About this Topic