Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Posts
    434
    Thanks
    7
    Thanked 3 Times in 3 Posts

    RSS feed will not validate

    For some reason I am unable to get RSS to work properly.

    It seems to work sort of in FireFox but not in IE.

    Using the w3c Validator site it shows errors...

    I have put stars *** to indicate what line these errors are on.

    what is wrong with my code?

    can anyone help me out.



    ----
    This feed does not validate.

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

    <guid>http://site.co.uk/?ac=vi&a=28012010</guid>
    ______________^

    In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendation.


    line 3, column 0: Undocumented use of atom:link [help]

    <atom:link href="http://http://site.co.uk/rss.php" rel="self" type="appli ...
    ----


    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    *line 3*<atom:link href="http://http://site.co.uk/rss.php" rel="self" type="application/rss+xml" />
    <channel>
    <ttl>1</ttl>
    <title>Welcome to Recent updates</title>
    <link>http://site.co.uk/?s=rssimg</link>
    <description>RSS Feed</description>
    <language>en-us</language>
    <pubDate>Sat, 06 Feb 2010 13:14:48 GMT</pubDate>
    <lastBuildDate>Sat, 06 Feb 2010 13:14:48 GMT</lastBuildDate>
    
    <generator>OnTheFly</generator>
    <image>
      <title>Welcome to Recent updates</title>
      <url>http://site.co.uk/images/image.png</url>
      <link>http://site.co.uk/?s=rssimg</link>
      <width>88</width>
      <height>31</height>
    
    </image>
    	<item>
    		<title>View items</title>
    *line 21*		<guid>http://site.co.uk/?ac=v&a=20</guid>
    		<pubDate></pubDate>
    	</item>
    
    	<item>
    
    		<title>View Minutes</title>
    		<guid>http://site.co.uk/?m=22</guid>
    		<pubDate></pubDate>
    	</item>
    
    	<item>
    		<title>Next meeting</title>
    		<guid>http://site.co.uk/?ac=v&a=20</guid>
    
    		<pubDate></pubDate>
    	</item>
    
    </channel>
    </rss>

  2. Users who have thanked needsomehelp for this post:

    james121 (02-08-2010)

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You don't use <atom:link in an rss feed. You just use the first <link> element to define the url to your feed. Any ampersands & need to be changed to their html entities e.g. &amp; and GUIDs need to be unique. You repeated a few of your GUIDs. Also you can't have an empty pubDate. If its going to be empty don't put it in your feed.
    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
    <ttl>1</ttl>
    <title>Welcome to Recent updates</title>
    <link>http://site.co.uk/rss.php</link>
    <description>RSS Feed</description>
    <language>en-us</language>
    <pubDate>Sat, 06 Feb 2010 13:14:48 GMT</pubDate>
    <lastBuildDate>Sat, 06 Feb 2010 13:14:48 GMT</lastBuildDate>
    
    <generator>OnTheFly</generator>
    <image>
      <title>Welcome to Recent updates</title>
      <url>http://site.co.uk/images/image.png</url>
      <link>http://site.co.uk/?s=rssimg</link>
      <width>88</width>
      <height>31</height>
    
    </image>
    	<item>
    		<title>View items</title>
    		<guid>http://site.co.uk/?ac=v&amp;a=20</guid>
    		<pubDate>Sat, 06 Feb 2010 13:14:48 GMT</pubDate>
    	</item>
    
    	<item>
    
    		<title>View Minutes</title>
    		<guid>http://site.co.uk/?m=22</guid>
    		<pubDate>Sat, 06 Feb 2010 13:14:48 GMT</pubDate>
    	</item>
    
    	<item>
    		<title>Next meeting</title>
    		<guid>http://site.co.uk/?ac=v&amp;a=23</guid>
    
    		<pubDate>Sat, 06 Feb 2010 13:14:48 GMT</pubDate>
    	</item>
    
    </channel>
    </rss>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Oct 2009
    Posts
    434
    Thanks
    7
    Thanked 3 Times in 3 Posts
    I have taken out the

    <atom:link href="http://http://site.co.uk/rss.php" rel="self" type="application/rss+xml" />

    and replaced the & with &amp;

    but still getting an error with validator.
    ----
    This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

    line 16, column 35: Image link doesn't match channel link [help]

    <link>http://site.co.uk/?s=rssimg</link>
    ^
    line 41, column 0: Missing atom:link with rel="self" [help]

    </channel>
    ----

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    What validator are you using?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    You don't use <atom:link in an rss feed.
    The W3C validator does actually suggest including the atom link in RSS feeds, I believe.

    The syntax is incorrect in the atom:link line. You're prefixing http:// to the URI.

    Code:
    <atom:link href="http://http://site.co.uk/rss.php" rel="self" type="application/rss+xml" />

    Edit: I'd also suggest using the Validome validator. It doesn't give those poxy, (and pointless), 'warnings' like the W3C validator does, and it covers more than just feeds to boot:

    http://www.validome.org/
    Last edited by MattF; 02-08-2010 at 01:43 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •