C($parent, $attr); } function C(&$parent, $attr) { $this->parent = &$parent; $this->init($attr); } function setHandler($parser) { xml_set_element_handler($parser, $this->getCallBack('element_start'), $this->getCallBack('element_end')); xml_set_character_data_handler($parser, $this->getCallBack('element_cdata')); } function &getCallBack($func) { $cb = array(); $cb[] = &$this; $cb[] = $func; return $cb; } function init($attr) { } function final() { } function element_cdata($parser, $data) { } function element_start($parser, $name, $attr) { } function element_end($parser, $name) { if ($name == $this->getName()) { $this->parent->setHandler($parser); $this->final(); } } function getName() { trigger_error('not implemented'); } } ?>