You are here

function ARC_rdfxml_parser::init in Taxonomy import/export via XML 5.2

Same name and namespace in other branches
  1. 5 arc/ARC_rdfxml_parser.php \ARC_rdfxml_parser::init()
  2. 6.2 arc/ARC_rdfxml_parser.php \ARC_rdfxml_parser::init()
  3. 6 arc/ARC_rdfxml_parser.php \ARC_rdfxml_parser::init()
3 calls to ARC_rdfxml_parser::init()
ARC_rdfxml_parser::parse_data in arc/ARC_rdfxml_parser.php
ARC_rdfxml_parser::parse_file in arc/ARC_rdfxml_parser.php
ARC_rdfxml_parser::parse_web_file in arc/ARC_rdfxml_parser.php

File

arc/ARC_rdfxml_parser.php, line 105

Class

ARC_rdfxml_parser

Code

function init($create_parser = true) {
  $this->triples = array();
  $this->subjs = array();
  $this->nsps = array();

  /* namespace prefixes */
  $this->bnode_id = 0;
  $this->s_count = 0;
  $this->t_count = 0;
  $this->xml_lang = "";
  $this->state = 1;
  $this->xml_base = "";
  $this->result_headers = array();
  $this->encoding = "UTF-8";

  /* base */
  if ($base = $this->init_args["base"]) {
    $this
      ->set_base($base);
  }

  /* bnode_prefix */
  if ($bnode_prefix = $this->init_args["bnode_prefix"]) {
    $this->bnode_prefix = $bnode_prefix;
  }
  else {
    $this->bnode_prefix = "arc" . substr(md5(uniqid(rand())), 0, 4) . "b";
  }

  /* save_data */
  if (isset($this->init_args["save_data"])) {
    $this->save_data = $this->init_args["save_data"];
    $this->data = "";
  }

  /* max_lines */
  if (isset($this->init_args["max_lines"])) {
    $this->max_lines = $this->init_args["max_lines"];
  }

  /* encoding */
  if (isset($this->init_args["encoding"]) && $this->init_args["encoding"]) {
    $this->encoding = $this->init_args["encoding"];
  }

  /* parser */
  if ($create_parser) {
    $this
      ->create_parser();
  }
}