27 $oParser = xml_parser_create(
'UTF-8');
28 xml_set_object($oParser, $this);
29 xml_set_element_handler($oParser,
"_tagOpen",
"_tagClosed");
30 xml_set_character_data_handler($oParser,
"_tagBody");
32 xml_parse($oParser, $input);
33 xml_parser_free($oParser);
35 if(count($this->output) < 1)
39 $this->output = array_shift($this->output);
53 $obj =
new stdClass();
54 $obj->node_name = strtolower($node_name);
56 $obj->childNodes = array();
58 $this->output[] =
$obj;
71 $this->output[count($this->output) - 1]->body .= $body;
82 $node_name = strtolower($node_name);
83 $cur_obj = array_pop($this->output);
84 $parent_obj = &$this->output[count($this->output) - 1];
85 $tmp_obj = &$parent_obj->childNodes[$node_name];
89 if(is_array($tmp_obj))
91 $tmp_obj[] = $cur_obj;
95 $tmp_obj = array($tmp_obj, $cur_obj);
_tagClosed($parser, $node_name)
_tagOpen($parser, $node_name, $attrs)