2008-09-30 2 views
0

누락되었습니다XML 구문 분석 오류 : SYSTEM 또는 PUBLIC, URI가 나는 다음 URL에서 RSS 피드를 구문 분석하고

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

코드가 작동하는데, 텍스트를 잘못 가져와야합니다.