sto diventando scemo, con la validazione di un feed RSS, creato dinamicamente via PHP...
Posto prima il codice:
Codice PHP:
header("Content-Type: application/xml"); 
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
echo 
"<rss version=\"2.0\">\n
<channel>\n
<title>ShaVis RSS feeder</title>\n
<link>[url]http://www.shavis.com[/url]</link>\n
<description>the visual's arts newsnet</description>\n
<language>en-EN</language>\n
<image>\n
<title>ShaVis RSS feeder</title>\n
<url>[url]http://www.shavis.com/logostart.jpg[/url]</url>\n
<link>[url]http://www.shavis.com[/url]</link>\n
</image>\n
"
;
    
$link "http://www.shavis.com/onefeed.php?feed=";
$today date("Y-m-d");
$week date("Y-m-d" strtotime('+1 week'));
    list(
$anno$mese$giorno) = explode("-"$today); 
    
$mese $mese+3;
    if (
$mese == || $mese == || $mese == || $mese == || $mese == || $mese == || $mese == || $mese == || $mese == 9) {
    
$mese "0" $mese;
    } 
    
$month3 $anno "-" $mese "-" $giorno
    
$result mysql_query("SELECT * FROM `news` WHERE `date` <= '$week' AND (`deadline` = '000-00-00' OR `deadline` >= CURDATE()) AND `date` <= '$month3' ORDER BY `news_id` DESC");
        while (
$row mysql_fetch_array($result)) {
        
$tit $row["title"];
        
$tit str_replace("®","&reg;","$tit");
        
$tit strtoupper($tit);
        
$tit str_replace("é","&Eacute;","$tit");
        
$tit str_replace("à","&Aacute;","$tit");
        
$tit str_replace("á","&Aacute;","$tit");
        
$tit str_replace("ò","&Oacute;","$tit");
        
$tit str_replace("è","&Eacute;","$tit");
        
$tit str_replace("ì","&Iacute;","$tit");
        
$tit str_replace("ù","&Uacute;","$tit");
        
$testo $row["text"];
        
$testo str_replace("–","-","$testo");
        
$testo str_replace("…","...","$testo");
        
$testo str_replace("
"
,"\n","$testo");
        
$testo str_replace("’","'","$testo");
        
$testo str_replace("‘","'","$testo");
        
$testo str_replace("“","","$testo");
        
$testo str_replace("”","","$testo");
        
$testo str_replace("&amp;","and","$testo");
        
$testo str_replace("& ","and ","$testo");
        
$testo str_replace("\x92","'","$testo");
        
$testo str_replace("\x91","'","$testo");
    
$nrmax "60";
$lunghezza strlen($testo);
if (
$lunghezza $nrmax) {
$testo strSelect$testo60 ) . " ...";
} else {
$testo $testo;
}
echo 
"<item>\n";
echo 
"<title>" $tit "</title>\n";
echo 
"<link>" $link $row["news_id"] . "</link>\n"
echo 
"<description>" $testo "</description>\n";
//echo "<date>"  . $row["date"] . "</date>\n";
echo "</item>\n";
}
echo 
"</channel>\n
</rss>"
;
Questo, invece, è l'elenco degli errori che mi da il validator del w3c:
This feed does not validate.
* line 667, column 34: XML parsing error: <unknown>:667:34: not well-formed (invalid token) [help]
<title>THE ART AND STYLE OF SARA & GERALD MURPHY</title>
In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
* line 27, column 0: item should contain a guid element (113 occurrences) [help]
</item>
* line 495, column 23: title contains bad characters (2 occurrences) [help]
<title>STAY ALIVE TILL \x9195</title>
Perchè mi indica come errore lo spazio vuoto dopo & nel title?
E soprattutto, perchè il title riporta il segno &, quando c'è l'istruzione di sostituirlo con and?
Perchè mi scrive questo segno \x91 (nel testo c'è il segno ), visto che c'è l'istruzione di sostituire sia che \x91 con '?
Any help?