Jump to content
cmscritic

RSS feed not validating

Recommended Posts

@cmscritic,

The message I'm seeing there says "Error has been logged." What are you seeing in your error log?

Share this post


Link to post
Share on other sites

@cmscritic,

The message I'm seeing there says "Error has been logged." What are you seeing in your error log?

Try again. I reinstalled the module to see if that would help. It's now showing the issue

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Thanks for the suggestion but I think the key is this line, which needs to somehow be altered.:

This feed does not validate.

  • line 103, column 2: XML parsing error: <unknown>:103:2: not well-formed (invalid token) [help]

    	</div><!--/#content-->  ^
  • Like 1

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

/netcarver shoots back up to safety.

Share this post


Link to post
Share on other sites

It's ryan's core module Markup RSS

I can see where the problem is (a </div> ) and it appears to be in my _main.php but I can't seem to figure out how to get around it as it needs to be there.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Where is the opening div?

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Ryan just fixed things up so we are good now. Thanks all for your help.

  • Like 2

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By benbyf
      related to this topic on wireSendFile(). I've been trying to create a RSS feed for a podcast which i've done previously using PW 2.7.2 with no trouble (e.g. http://machine-ethics.net/), however sitting on the same infustructure a new site (http://www.threepointspodcast.com/) on PW 3.0.42 is having issues validating with itunes with this error from them: Can’t submit your feed. Your episodes are hosted on a server which does not support byte-range requests. Enable byte-range requests and try again. Which is obviously untrue as the other podcast works fine.
      Just wondering if there's something I need to add in the template settings etc to make it work, I'm currently running the .mp3 file out using wireSendFile() and setting the type to application/mp3 in template settings but with no avail. I'm running nginx.
      Any help would be appreciated.
    • By clsource
      Hello I made a simple app for reading the main RSS for ProcessWire news.
      Now you can access ProcessWire Blog, ProcessWire weekly and the Latest Forum Posts in a Single App
      in your iOS or Android smartphone. Open Source of Course.
      Made using the http://jasonette.com technology.

      You can compile your own app if you want.
      For A Quick Look

      1.- Download the Jason App

      (iOS) https://itunes.apple.com/us/app/jason./id1095557868?mt=8
      (Android) https://play.google.com/store/apps/details?id=com.jasonette.jason

      2.- Use the Following Url

      https://raw.githubusercontent.com/NinjasCL/pw-app/master/app.json

       

       
      Source Here
      https://github.com/NinjasCL/pw-app
       
       
    • By muffin-man
      I just recently found about processwire a few days ago and now I am currently stuck on modules. I followed the directions on installing it and then inserted the example codes into both a blank template and a pre-built template I made and it shows nothing. I also changed the rss link to something from CNN to see if it was just the URL, but it still shows nothing. I'm not sure if it has something to do with the get function. I implemented this sample into a php template.
      <?php $rss = $modules->get("MarkupLoadRSS");  $rss->load("http://www.cnn.com/services/rss/"); foreach($rss as $item) {  echo "<p>"; echo "<a href='{$item->url}'>{$item->title}</a> "; echo $item->date . "<br /> "; echo $item->description;  echo "</p>"; } ?>  
      Please advise
    • By benbyf
      HELLO!
      Just in case anyone's interested I've just started this podcast http://www.machine-ethics.net/
      I sent less than a day building the site so be kind. I'm looking to improve it and make it available as a site profile as it has an rss feed that itunes can pick up and use which may be useful for anyone else creating podcasts.
      cheers
    • By aren
      Hi everyone!
      I've been away from web dev for a while (designing more), so I'm feeling a bit out of touch.
      Can anyone tell me what's the best way to combine multiple rss feeds in one single site/page these days? Preferably with javascript (or is there a better way these days?)
      What I want to do is to fetch only the images of multiple (hundreds, probably) rss feeds and display them in one site/page as one big gallery.
      Thanks, and cheers! 
×
×
  • Create New...