- $this->datas = array();
- $this->parser = xml_parser_create();
- xml_set_object($this->parser, $this);
- xml_parser_set_option($this->parser, XML_OPTION_SKIP_WHITE, 1);
- xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
- xml_set_element_handler($this->parser, 'tag_open', 'tag_close');
- xml_set_character_data_handler($this->parser, 'cdata');
- if (!xml_parse($this->parser, $data))
- {
- $this->data = array();
- $this->error_code = xml_get_error_code($this->parser);
- $this->error_string = xml_error_string($this->error_code);
- $this->current_line = xml_get_current_line_number($this->parser);
- $this->current_column = xml_get_current_column_number($this->parser);
- }
- else
- {
- $this->data = $this->data['subs'];
- }
- xml_parser_free($this->parser);
+ $this->error_code = xml_get_error_code($this->parser);
+ $this->error_string = xml_error_string($this->error_code);
+ $this->current_line = xml_get_current_line_number($this->parser);
+ $this->current_column = xml_get_current_column_number($this->parser);
+ }
+ else{
+ $this->data = $this->data['subs'];
+ }
+ xml_parser_free($this->parser);