WordPress.org

Ready to get started?Download WordPress

Forums

XML Parsing Error: xml processing instruction not (40 posts)

  1. chenu
    Member
    Posted 9 years ago #

    I'm getting an error message when i try to view my rss files and this is causing some webblog bots to not understand my site. Here's the error message:
    XML Parsing Error: xml processing instruction not at start of external entity
    Location: http://chenu.uni.cc/wp-rss2.php
    Line Number 1, Column 2: <?xml version="1.0" encoding="utf-8"?>
    -^
    This come in the news and comments rss files.

  2. chenu
    Member
    Posted 9 years ago #

    Can anyone please help me?

  3. rootkill
    Member
    Posted 9 years ago #

    I have the same parse error with my WP: it's caused by the permalink structure. When I customized my permalinks (I can't use .htaccess with my hosting) for the first time, I see that RSS links point to /feed/RSS and /comments/feed/RSS which didn't exist... so I've restored the default structure of permalinks, but I received that error! The "^_" symbol is the same needed by the .htaccess file to change the URL for printing the RSS feed... but I do not know how to restore the default config (that is the way to solve the problem: before editing permalinks everything ran well)...

  4. Anonymous
    Unregistered
    Posted 9 years ago #

    The error results when you have any whitespace before your XML declaration tag. You have to eliminate any areas that might be generating whitespace before the XML declaration tag is outputted.
    -brendon
    endofyourself aat yahooooo dotcom

  5. chenu
    Member
    Posted 9 years ago #

    i don't understand what to do. I tried removing some spaces but where do you remove them.

  6. chenu
    Member
    Posted 9 years ago #

    here is my rss2.php code
    <?php
    if (!isset($feed)) {
    $blog = 1;
    $doing_rss = 1;
    require('wp-blog-header.php');
    }
    $more = 1;
    $charset = get_settings('blog_charset');
    if (!$charset) $charset = 'UTF-8';
    header('Content-type: text/xml', true);
    ?>
    <?php echo '<?xml version="1.0" encoding="' . $charset . '"?'.'>'; ?>
    <!-- generator="wordpress/<?php echo $wp_version ?>" -->
    <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <channel>
    <title><?php bloginfo_rss('name') ?></title>
    <link><?php bloginfo_rss('url') ?></link>
    <description><?php bloginfo_rss("description") ?></description>
    <copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate()); ?></copyright>
    <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), 0); ?></pubDate>
    <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator>
    <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
    <item>
    <title><?php the_title_rss() ?></title>
    <link><?php permalink_single_rss() ?></link>
    <comments><?php comments_link(); ?></comments>
    <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', $post->post_date_gmt, 0); ?></pubDate>
    <?php the_category_rss() ?>
    <guid><?php the_permalink($id); ?></guid>
    <?php if (get_settings('rss_use_excerpt')) : ?>
    <description><?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?></description>
    <?php else : ?>
    <description><?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?></description>
    <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
    <?php endif; ?>
    <wfw:commentRSS><?php echo comments_rss(); ?></wfw:commentRSS>
    </item>
    <?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
    </channel>
    </rss>

  7. Anonymous
    Unregistered
    Posted 9 years ago #

    I am having the same problem. I have not been able to figure out the file that is causing the extra ' ' in the front of the <?xml line.
    I am new to php, am I to assume that any files that have all code in them must end with ?> and not ?>(then a new line)?
    Any help pointing to what files I need to look at would be appreciated. I would like to get this working.
    Thank you.
    Perogi.
    http://www.perogi.org

  8. Matt Mullenweg
    Troublemaker
    Posted 9 years ago #

    The extra space often comes from a plugin or WordPress file that you edited.

  9. Anonymous
    Unregistered
    Posted 9 years ago #

    allusion
    Thank you for your reply. So you are saying that you should always make sure that php files end with ?> (where appropriate) and never with a newline?
    Which include files are used for the rss feed?
    Thanks again!
    Perogi.

  10. Anonymous
    Unregistered
    Posted 9 years ago #

    It would be helpful if someone who uses php could answer this question for me. I am a Java coder, not php and don't know of all of the intracacies of the language.
    Thanks in advance.
    Perogi.

  11. Anonymous
    Unregistered
    Posted 9 years ago #

    I figured it out.
    One of the plugins was jacked up. Anyone else with this problem may want to check them first (since it's easy to refresh your wp-rss2.php file).
    Perogi.

  12. Anonymous
    Unregistered
    Posted 9 years ago #

    I would like to confirm that with the same problem (i.e. "XML parsing error) I have fixed the bug removing the \newline character at the bottom of one .php file
    Paolo

  13. Anonymous
    Unregistered
    Posted 9 years ago #

    Yes,
    ALL whitespace from any includes or before or after any PHP delimiter tags must be eliminated as well.
    Brendon
    endofyourself AAATTT yahoooo dotcom

  14. robgreeley
    Member
    Posted 9 years ago #

    Hi - I am having the same problem and am struggling a bit here - looking for places where I may have white space in one blog, but not in others. So far no luck.
    In which files have you been finding the errors? Perogi - you found it in a plugin - which plugin?
    thanks

  15. opioid
    Member
    Posted 9 years ago #

    Yeah, what plugin dude?

  16. opioid
    Member
    Posted 9 years ago #

    XML Parsing Error: xml processing instruction not at start of external entity
    Location: http://site/wp/wp-rss2.php
    Line Number 1, Column 3: <?xml version="1.0" encoding="utf-8"?>
    --^
    What is with this?
    XML Parsing Error: xml processing instruction not at start of external entity
    Location: http://site/wp/wp-commentsrss2.php
    Line Number 1, Column 2: <?xml version="1.0" encoding="utf-8"?><!-- generator="wordpress/1.2" -->
    -^

  17. DocBastardo
    Member
    Posted 9 years ago #

    In my case, it was the "Acronym" plugin.

  18. tonx
    Member
    Posted 9 years ago #

    My girlfriend solved this for me

    around line 4 in wp-blog-header.php there is a ?> with some bad spacing before the next <?

    fixing this makes everything happy.

  19. krimple
    Member
    Posted 9 years ago #

    Hey, here's the plugin that caused me trouble: it was Link Library (which I'm not using anyway). It had extra whitespace in the processing instruction area. Just deactivate it and see if that helps you.

    Ken

  20. tedfox
    Member
    Posted 8 years ago #

    hmm. blogtimes is giving me error. and i don't know how to fix it.

    blogtimes is the one causing the error for me

  21. stfarm
    Member
    Posted 8 years ago #

    Hi guys,

    I have the same problem:
    XML Parsing Error: xml processing instruction not at start of external entity
    Location: http://www.geektavern.com/index.php/feed/
    Line Number 3, Column 1:<?xml version="1.0" encoding="UTF-8"?>
    ^

    I disabled ALL of the plugins, fixed all the white space issues. It just will not work.

    I am hosted on a windows platform, so I don't use the .htaccess file.

    Could somebody please let me know what I am over looking. Thank you.

    Steve Farmer
    http://www.GeekTavern.com

  22. euicho
    Member
    Posted 8 years ago #

    I had the same error message and fixed it by disabling Scott Hanson's "Auto-Close Comments v.0.1" plug-in. :) Thanks for the tips guys!

  23. dubsix
    Member
    Posted 8 years ago #

    Posting in the hope that this may be of help to others ...

    Had the same problem --> the extra whitespace was caused by the (most excellent) Theme Switcher plugin, it had an extra line at the top of the code. Cheers!

  24. g3bbonsj
    Member
    Posted 8 years ago #

    I am a wordpress newbie. I am having the same issue, i.e.
    I cannot subscribe to my own RSS feed, and getting the same
    error: "XML Parsing Error: xml processing instruction not at start of external entity"

    I believe my issue is that refered to by dubsix, i.e. I used the
    themeswitcher plugin. Now, how do I go about fixing it?

  25. fatalcure
    Member
    Posted 8 years ago #

    I have a tonne of plugins.. how am I supposed to find where it is..

  26. g3bbonsj
    Member
    Posted 8 years ago #

    I was able to fix my issue. What I did was go to the Plug Ins tab on WordPress, then make a note of which ones were enabled. Then I disabled them all. My RSS feed now works. Then I set about reenabling them. I only had 3 plugins since this is my first blog so it wasn't too much trouble. (The odd thing is I'm pretty sure I reenabled all the ones I disabled and it still works - not 100% sure about that tho')

  27. japanwindow
    Member
    Posted 8 years ago #

    I am using WordPress 2.0. It's newly installed, and even with all plug-ins disabled I'm having this problem. Any help would be appreciated. The blog is at:

    http://www.japanwindow.com/diffuser/

  28. japanwindow
    Member
    Posted 8 years ago #

    I fixed the problem by reinstalling the blog. I rebuilt it exactly as before, but this time the RSS is working. I wish I know why it broke, but at least it's fixed.

  29. kochugov
    Member
    Posted 8 years ago #

    i got some problem

    fixed by disab—É each of installed plugin

    my bug in WP-ShortStat plugin

  30. meisenstadt
    Member
    Posted 7 years ago #

    Yow; I'm struggling big-time with feedvalidator.org (recently, this past month) complaining at the very fist line of my RSS2 feed (detailed error at the end).

    I have been up and down all the forums, FAQs, etc, and finding that there are 'extra whitespace' issues is almost beyond belief. Whitespace should not cause such a huge number of headaches in this day and age.

    No I find my blog is no longer picked up by Bloglines or Technorati as a result of *SOMETHING* that happened in the last month, and am really stumped.

    The error:


    This feed does not validate.

    line 1, column 30: XML parsing error: <unknown>:1:30: XML declaration not well-formed [help]

    <?xml version="1.0" encoding="'.get_settings('blog_charset').'"?>

    Even if I 'hardwire' the 'apparently unevaluated get_settings' to say "utf-8" I still get an error (this time complaining about the blank line 1).

    Anyone got a suggestion? All plugins are disabled EXCEPT Akismet which I need desperately for spam detection. Moreover it worked fine until this month.

    Many thanks!
    -M

Topic Closed

This topic has been closed to new replies.

About this Topic