2010-07-12 4 views
0

SimplePie를 사용하여 XML을 구문 분석하려고합니다. 만약 내가 force_feed를 TRUE로 설정하지 않았다면 SimplePie는 이것을 RSS로 인식하지 못한다. SimplePie를에 의해 표시되는 오류 메시지 : XML 문서의SimplePie XML 문서가 유효하지 않습니다.

This XML document is invalid, likely due to invalid characters. XML error: Not well-formed (invalid token) at line 1, column 1

첫 번째 두 라인은 다음과 같습니다 여기에 무엇이 잘못되었는지

<?xml version="1.0" encoding="ISO-8859-1"?> 
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> 

어떤 생각?

편집 (코드 업데이트) :

$feed_stomp = new SimplePie(); 
$feed_stomp->set_feed_url('http://singaporeseen.stomp.com.sg/site/servlet/rss?view=rss&vertical=contentbean%3a3552'); 
$feed_stomp->force_feed(true); 
$feed_stomp->init(); 
$feed_stomp->handle_content_type(); 
echo $feed_stomp->error(); 

답변

1

당신은 아마도 문자열에서 BOM을 떠났다.
코드를 알려주십시오.

+0

감사합니다. 코드로 질문을 업데이트했습니다. – SteD

관련 문제