Support » Fixing WordPress » Can someone tell my why this rss2 doesn’t validate

  • My rss2 does not validate at all I dont understand why it returns the error "line 6, column 2: XML parsing error: <unknown>:6:2: not well-formed (invalid token)"

    for <title>

    Heres my rrs2.php I dont see anything worng in it?

    [moderated – removed long code.
    Don’t post long code here, please!
    It is difficult to read and nobody really bothers to take a look at it. You can use or similar services – and post back with the URI.
    For posting small code snippets, please read carefully the instructions here below the text input area: the “backticks” usually are located on top-left of your keyboard, where ~ [tilde] is.
    Thank you for your understanding!]

Viewing 8 replies - 1 through 8 (of 8 total)
  • You have very strange URL, e.g. for a single post:

    It looks like your site is generated by Joomla/Mambo, I’m guessing that’s the odd permalink structure, but perhaps that’s the problem with the RSS as well?

    Actually I think I found out why, it is

    <guid isPermaLink="false">
    <?php the_guid(); ?></guid>

    Not sure how or what yet though will fix it besides taking it right out.

    If you’re using & in your guid link, that should be encoded as &amp; – one of the basic rules of XML.

    I have been looking for an answer to this and I’m sure my problem with my rss2 feed is the one mentioned by Yngwin.

    I have a question, how do you encode automatically “&” as “&”?

    You see, the problem I have is that the posts in my blog come from different sources, and I like to point the visitors to the original post in the original blog that wrote such article or post.

    Many of those sites have “&” in their link structure and that’s why I have the errors when validating.

    I don’t know if I was clear enough, english is not my mother language.

    Thanks in advanced,

    The second paragraph should be:

    I have a question, how do you encode automatically “&” as “& a m p ;”?

    Sorry about this…..

    This is probably a bit late to be useful to you, but i also had the same problem and here’s how I fixed it:

    I modified the function the_guid() in line 53 of

    it started as :
    function the_guid( $id = 0 ) {
    echo get_the_guid($id);

    and I changed it to:
    function the_guid( $id = 0 ) {
    $guid = get_the_guid($id);
    $guid = eregi_replace('(&)(.{3,6}[^;])','&amp;\2',$guid);
    echo $guid;

    then everything was suddenly valid.

    well, it was indented, but thats html for you…

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Can someone tell my why this rss2 doesn’t validate’ is closed to new replies.