Feed validation problems

Discussion in 'XML & RSS' started by mherzber, Feb 2, 2008.

  1. #1
    I am having problems with validating this feed

    http://www.bloghighed.org/agg/feed.php

    I'm not much of an xml expert so any help is appreciated. My main thing is a am trying to bring this feed into Feedburner, but it need to validate to do that

    Here is the code

    <?
    
    
    
    
    
    $start = 0;
    $limit = 20;
    
    $query = "SELECT title, url, item_title, item_date, item_url, item_text FROM feed_item left join
    	feed_list on feed_item.item_fk = feed_list.id 
    	where item_date <= NOW()
    	order by item_date desc
    	LIMIT $start, $limit";
    	
    	$result = mysql_query($query);
    	
    function unhtmlspecialchars( $string )
       {	
       	   //$string = preg_replace("/[^a-zA-Z0-9s]/", "", $string);
           $string = str_replace ( '&','&#38;', $string );
           //$string = str_replace ( '\'','&apos;', $string );
           $string = str_replace ( '\"','&quot;',  $string );
           $string = str_replace ( '<','&lt;',  $string );
           $string = str_replace ( '>','&gt;',  $string );
    
          
           return $string;
       }
    
    echo "<?xml version='1.0' ?>\n";
    echo "<rss version='2.0'>\n";
    echo "<channel>\n";
    echo "<title>BlogHighEd.org</title>\n";
    echo "<link>http://www.bloghighed.org/</link>\n";
    echo "<description>A blogging network for higher ed bloggers.</description>\n
    <language>en-us</language>\n
    <docs>http://www.bloghighed.org/feed.php</docs>\n";
    
    	while($item = mysql_fetch_array($result)){
    		if($item['title'] != 'HighEd Channel'){
    		echo  "\n<item>\n";
    		echo  "<title>" . unhtmlspecialchars($item['title']) . ' - ' . unhtmlspecialchars(str_replace("?","",$item['item_title'])) . "</title>\n";
    		echo  "<description>" . unhtmlspecialchars(str_replace("?","",substr($item['item_text'],0,255))); if(strlen($item['item_text']) >= 255) echo "..."; echo "</description>\n";
    		echo  "<link>" . unhtmlspecialchars($item['item_url']) . "</link>\n";
    		echo  "<pubDate>" . $item['item_date'] . "</pubDate>\n";
    		echo  "</item>\n"; 
    		}
    	}
    
    echo "</channel>\n";
    echo "</rss>\n";
    
    ?>
    
    Code (markup):
    Any help is greatly appreciated.
     
    mherzber, Feb 2, 2008 IP