You are here

function ARC_erdf_parser::parse_data in Taxonomy import/export via XML 5

Same name and namespace in other branches
  1. 5.2 arc/ARC_erdf_parser.php \ARC_erdf_parser::parse_data()
  2. 6.2 arc/ARC_erdf_parser.php \ARC_erdf_parser::parse_data()
  3. 6 arc/ARC_erdf_parser.php \ARC_erdf_parser::parse_data()

File

arc/ARC_erdf_parser.php, line 295

Class

ARC_erdf_parser

Code

function parse_data($data) {
  $this
    ->init(false);
  $this->encoding = $this->encoding == "auto" ? "UTF-8" : $this->encoding;
  $this
    ->create_parser();
  if ($this->save_data) {
    $this->data = $data;
  }
  if (!($success = xml_parse($this->parser, $data, true))) {
    $error_str = xml_error_string(xml_get_error_code($this->parser));
    $line = xml_get_current_line_number($this->parser);
    xml_parser_free($this->parser);
    return "XML error: '" . $error_str . "' at line " . $line . "\n";
  }
  $this->target_encoding = xml_parser_get_option($this->parser, XML_OPTION_TARGET_ENCODING);
  xml_parser_free($this->parser);
  return $this
    ->done();
}