Jump to content

RSS feed not validating


cmscritic
 Share

Recommended Posts

Ok, I can't tell you which file to edit; I simply don't know but I have seen problems like this in the past and they were either due to byte-order-marks* that were being saved by someone's editor as it wrote out the a PHP file or some whitespace at the beginning or end of a PHP file that is being output as part of the feed where it isn't valid to have it in XML.

I can't guarantee that either of these are the problem in your case but then again, perhaps they are. Anyway, here are some clues as to what to do to find out...

  1. Grep your PW installation - particularly modules and your own templates - for "?>" near the end of files. If there is HTML following the "?>" then it is needed - if there is only what appears to be whitespace remove the ?> to the end of the file and save the file. Sometimes people put ?> at the end of their PHP files and don't realise that *any* whitespace following the ?> tag will be output verbatim as part of the output stream by PHP.
  2. Re-save each suspect file from an editor that you can configure to save as utf-8 and not to save with the Byte-order-mark. (Notepad++ on Windows is one good candidate.)

* Covers one troublesome aspect of BOMs. The other is that if they appear at the start of your PHP file, before the "<?php" then even though they might be correctly handled by your code editor, PHP can emit them as part of the output stream as it appears before the start of PHP interpretation. If the PHP file is building a feed then the invisible BOM is emitted straight into your XML - probably invalidating it.

Anyway, that's the mental model I had of this when I ran across something pretty similar to this a few years ago and managed to fix it - I might be wrong though - in which case I await correction with anticipation.

Edited by netcarver
Edited to add link to article and a little more background.
Link to comment
Share on other sites

Hah, have to laugh at myself as there is a more probable cause which I totally overlooked and you even opened your topic with it! Ignore the above diatribe - it's only applicable if the tags are being closed right - which I now see is the point you were making.

I'll leave the embarrassing reply above as it might help someone else out one day. 

In the meantime, I'll swing back to my tree to consider a suitable penance for being obtuse. :)

  • Like 1
Link to comment
Share on other sites

Err, dare I creep down and suggest searching your installed files for "<!--/#content-->"?

/netcarver shoots back up to safety.

Found that in my main_php and since I use CodeAnywhere.com I can see it's not impressed with the placement of the </div> but it's needed so I'm not sure how to fix it.

Link to comment
Share on other sites

Hmm. Not only have I been obtuse today but my eyes are now playing tricks on me as I've downloaded your pastebin file so I can search it locally and I can't find the line your editor is highlighting as a problem in the pastebin version at all.

In the image you posted above you are doing an include of a footer file followed by output of a HTML5 footer - so perhaps that explains why you were seeing a double footer on the site (which I can't see from here at the moment BTW.)

Anyway, I see your feed is validating so I'm guessing this is now fixed. Please let us know!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...