代码之家  ›  专栏  ›  技术社区  ›  Devon

XML分析错误:系统或公共,缺少URI[已关闭]

  •  0
  • Devon  · 技术社区  · 18 年前

    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解析器解决此错误?

    编辑

    1 回复  |  直到 18 年前
        1
  •  0
  •   Paige Ruten    18 年前

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

    推荐文章