2008-09-30 63 views
0

我从以下网址解析RSS提要:XML解析错误:SYSTEM或PUBLIC,该URI缺少

http://rss.sciam.com/ScientificAmerican-Global?format=xml

// $xml_text is filled with the contents read from the URL 
$xml_parser = xml_parser_create(); 
$res = xml_parse($xml_parser, $xml_text); 

if (!$res) { 
    $error = 
    xml_error_string(xml_get_error_code($xml_parser)). 
    " at line ". 
    xml_get_current_line_number($xml_parser); 
} 

// $error contains: "SYSTEM or PUBLIC, the URI is missing at line 1" 

FeedValidator.org说,这是一个很好的饲料。

如何获取PHP的XML解析器来解决此错误?

编辑:看起来他们正在根据用户代理重定向到另一个位置。我的PHP脚本没有得到正确的提要。

回答

0

该代码适用于我,您必须使文本错误。