WordPress.org

Ready to get started?Download WordPress

Forums

XHTML Content Negotiation for WordPress
[Plugin: XHTML Content Negotiation for WordPress] XML Parsing Error: not well-formed (4 posts)

  1. mat8iou
    Member
    Posted 3 years ago #

    Since upgrading to WordPress 3.1, I've dound that I have to disable the XHTML content negotiation plugin that I was using, otherwise the pages fail to render in Firefox, coming ups with an error that says:
    XML Parsing Error: not well-formed... & then lists the line causing the problem (somewhere near the end of the pages code).

    As far as I can work out from having a quick look at the page source, this appears to be part of the code, that now creates the bar at the top of the page - in particular the part showing the site visitor stats.

    So its not really a problem with the XHTML content negotiation plugin - but more that running this highlights the badly formed XHTML code that is produced by WordPress / The site stats plugin.

    Has anyone else come across this problem? I tried fixing it by dropping from XHTML 1.1 to 1.0 transitional, but it seems that disabling the content negotiation plugin is the only way of making the pages render in Firefox.

  2. bluejpro
    Member
    Posted 3 years ago #

    My feed produced the parsing error with 3.0.

    fixed it, (something with whitespace) but I see it's returned with the upgrade to 3.1

    I don't remember the fix (darn it) but when I do I'll post it here.

    I am not sure the fault is purely your plugin's ...

  3. bluejpro
    Member
    Posted 3 years ago #

    Ok

    This is what worked for me just now
    http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/

    In a nutshell,
    edit wp-includes/feed-rss2.php

    find

    header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
    $more = 1;

    place this immediately after it

    $out = ob_get_contents();
    $out = str_replace(array("\n", "\r", "\t", " "), "", $input);
    ob_end_clean();

    Repeat with wp-includes/feed-rss2-comments.php

    I would suggest you check the source article, though -- that's where I copied the code that worked for me.

  4. solarissmoke
    Member
    Plugin Author

    Posted 3 years ago #

    Hi mat8iou,

    What theme are you using?

    Firefox will fall over if the page is not perfectly formed XHTML. This means that if your theme/ any plugins are using loose HTML/HTML5 (many new themes are using HTML5), then it will break.

    FWIW, my own recommendation (as author of the plugin) is to stop using XHTML and move to HTML5.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic