【问题标题】:XML Parsing Error: SYSTEM or PUBLIC, the URI is missing [closed]XML 解析错误:SYSTEM 或 PUBLIC,缺少 URI [关闭]
【发布时间】:2010-09-14 08:03:09
【问题描述】:

我正在解析来自以下 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 脚本没有得到正确的提要。

【问题讨论】:

    标签: php xml rss


    【解决方案1】:

    代码对我有用,你一定是把文字弄错了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-06-14
      • 1970-01-01
      • 2018-12-11
      • 1970-01-01
      • 2012-04-13
      • 1970-01-01
      • 2021-07-21
      • 1970-01-01
      相关资源
      最近更新 更多