RSS Doesn't Validate - No idea why?

Discussion in 'XML & RSS' started by theduke56789, Feb 26, 2006.

  1. #1
    Here's the validator response - the second error on line 4:
    http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.golfhomeconnect.com%2Frss%2Frss.xml


    Thanks a lot.


    Here's the php XML generation code:


    $strBody="<?xml version=\"1.0\" encoding=\"US-ASCII\"?> 
    						<rss version=\"2.0\">
    						<channel>
    						  <title>Golf Communities & Golf Homes - GolfHomeConnect</title>
             				<description>Discover golf course communities & golf homes at GolfHomeConnect</description>
    						  <link>http://www.golfhomeconnect.com/</link> 
    						  <language>en-us</language> 
    						  <copyright> Copyright 2005 by HomeConnect, LLC.</copyright>";
    
    PHP:
     
    theduke56789, Feb 26, 2006 IP
  2. TommyD

    TommyD Peon

    Messages:
    1,397
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I've had in the past I had problems with non-letter charactors.

    example: & ? ^

    hth,

    tom
     
    TommyD, Feb 26, 2006 IP
  3. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #3
    & should be &amp;
     
    RectangleMan, Feb 26, 2006 IP
  4. theduke56789

    theduke56789 Peon

    Messages:
    207
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks, I figured out how to convert characters with htmlspecialchars () after some investigation.

    Is there an easy way to convert the date to rfc 822 format?
     
    theduke56789, Feb 26, 2006 IP
  5. Seriph

    Seriph Guest

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    A googling resulted in this:

    
    strftime("%a, %d %b %Y %H:%M:%S %z")
    
    PHP:
    Should do just fine.
     
    Seriph, Feb 28, 2006 IP
  6. theduke56789

    theduke56789 Peon

    Messages:
    207
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks, but I'm a php idiot .... and any other coding for that matter.

    This is the date call

    <pubDate>".($row['dtAdded'])."</pubDate>

    How do I integrate the : strftime("%a, %d %b %Y %H:%M:%S %z")

    Thanks
     
    theduke56789, Mar 1, 2006 IP
  7. Seriph

    Seriph Guest

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    What does that part output right now?
    I ask so I can determine the format of the date you are already working with, then we can convert it over to the format you need.
     
    Seriph, Mar 1, 2006 IP
  8. theduke56789

    theduke56789 Peon

    Messages:
    207
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks for the help Seriph

    I think this is the standard sql format straight from the db.
    <pubDate>2006-03-01</pubDate>
     
    theduke56789, Mar 2, 2006 IP
  9. Seriph

    Seriph Guest

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Try this...

    
    "<pubDate>".strftime("%a, %d %b %Y %H:%M:%S %z", strtotime($row['dtAdded']))."</pubDate>"
    
    PHP:
     
    Seriph, Mar 2, 2006 IP
  10. theduke56789

    theduke56789 Peon

    Messages:
    207
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Genius thanks
     
    theduke56789, Mar 3, 2006 IP