Feed validation problem

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

  1. mherzber

    mherzber

    Joined:
    Feb 2, 2008
    Messages:
    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

    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 ( '&','&', $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' encoding='utf-8' ?>\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";
    
    ?>
    
    Any help is greatly appreciated.
    mherzber, Feb 2, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sukh
    Replies:
    1
    Views:
    395
    =?Utf-8?B?RFdT?=
    Mar 3, 2006
  2. darcye
    Replies:
    0
    Views:
    332
    darcye
    Mar 2, 2004
  3. thehuby@gmail.com

    Feed Validation Issue

    thehuby@gmail.com, Dec 25, 2006, in forum: XML
    Replies:
    2
    Views:
    419
    thehuby@gmail.com
    Dec 26, 2006
  4. Swapna Ch
    Replies:
    2
    Views:
    77
    Lars Haugseth
    May 31, 2010
  5. bnp
    Replies:
    4
    Views:
    291
Loading...

Share This Page