Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Feed validation problem

Reply
Thread Tools

Feed validation problem

 
 
mherzber mherzber is offline
Junior Member
Join Date: Feb 2008
Posts: 1
 
      02-02-2008
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation for feed links using by 'rss' Swapna Ch Ruby 2 05-31-2010 09:30 AM
How do you get feed discovery to work? I go to web pages I know has feeds, but the feed discovery button is disabled. Help! Tim Bryant Computer Support 1 02-13-2007 05:01 AM
Feed Validation Issue thehuby@gmail.com XML 2 12-26-2006 09:59 AM
Problem: Unwanted Paper feed after printing. Sukh ASP .Net 1 03-03-2006 03:30 PM
Form Validation Problem...Persisiting form fields on validation failure. bnp Javascript 4 05-12-2004 12:16 PM



Advertisments