Support » How-To and Troubleshooting » [Resolved] xml parse error in RSS feed URL

[Resolved] xml parse error in RSS feed URL

  • I found that RSS feed URL is output without using CER (character entity references) which causes XML parse error in a certain case.
    I request to fix this bug.

    1. I use wordpress with a MIME-type ‘application/xhtml+xml,’ thus many browser fail to parse xml if a url includes ‘&’ without using CER.
    2. I sometimes use the search form on my wordpress site to find old my article. The results of it includes RSS feed with search key words, e.g., http://url/wordpress/?s=search&feed=rss2
    3. After all my wordpress cannot return any search result without parse error.

    I believe that the RSS feed URL should be http://url/wordpress?s=search&feed=rss2

    I found temporal result.
    In the function get_search_link and get_search_feed_link at the file ‘link-templete.php,’ I added the following code:

    $link = str_replace('&','&',$link);
    $link = str_replace('&','&',$link);

    after calling the function apply_filters.

    I request to fix this bug. Thank you.

    At first, I try to fix the function build_query.
    However, this function used to search comment in dashboard and my fix induces another bug, that releases a comment_status attribute.

Viewing 7 replies - 1 through 7 (of 7 total)
  • I use wordpress with a MIME-type ‘application/xhtml+xml,’ thus many browser fail to parse xml if a url includes ‘&’ without using CER.

    How did you set that up?

    I use the plugin ‘XHTML Content Negotiation v1.5,’ which checks browser version and output the HTTP header ‘Content-type: application/xhtml+xml; charset=UTF-8’ if ‘USER-AGENT’ is not MSIE 8.0 or earlier.

    I tried IE6, IE9, Firefox4.0 and Chrome7. Above plugin returns application/xhtml+xml for IE9, Firefox4.0 and Chrome7; and returns text/html for IE6.
    XML parse error occurs IE9, Firefox4.0 and Chrome7.

    Tagging this post with “xhtml-content-negotiation-for-wordpress” so that plugin author gets notified. Basically the issue is with his plugin.

    Though the page says

    If you come across any bugs or have suggestions, please contact me at rayofsolaris.net.

    So you may want to do that.

    Also read this: http://wordpress.org/support/topic/plugin-xhtml-content-negotiation-for-wordpress-xml-parsing-error-not-well-formed?replies=4

    Samir Shah


    I’m the plugin author. The issue is not with the plugin, but with WordPress. feed_links_extra() should be escaping the ampersand, but it isn’t, and this generates invalid XHTML. Of course when you use a strict application/xhtml+xml MIME type this will cause your browser to bork.

    I’ve raised a ticket for this issue.

    Nice catch. 🙂

    There IS a possibility it’ll get punted since we;re moving from XHTML to HTML5, but hopefully not.

    Thank you all! Thank you for your patch!!

    I think this issue has consisted of 2 elements.
    First, wordpress output invalid XHTML 1.0, i.e. http://www.w3.org/TR/xhtml1/#C_12 .
    Second, even as the WP has above fact, I set my WP up to output HTTP header Content-type: application/xhtml+xml.

    Ticket #17408 has fixed this problem.
    Thank you.

    Samir Shah


    XHTML or HTML5, it’s still invalid 😉

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] xml parse error in RSS feed URL’ is closed to new replies.