You are here

public function XML2Array::parse in Opigno SCORM 3.x

Same name and namespace in other branches
  1. 8 src/XML2Array.php \Drupal\opigno_scorm\XML2Array::parse()

Parse function.

File

src/XML2Array.php, line 17

Class

XML2Array
Class XML2Array.

Namespace

Drupal\opigno_scorm

Code

public function parse($xlm_string) {
  $this->xml_parser = xml_parser_create();
  xml_set_object($this->xml_parser, $this);
  xml_set_element_handler($this->xml_parser, "tagOpen", "tagClosed");
  xml_set_character_data_handler($this->xml_parser, "tagData");
  $this->xml_string = xml_parse($this->xml_parser, $xlm_string);
  if (!$this->xml_string) {
  }
  xml_parser_free($this->xml_parser);
  return $this->output;
}