protected function handle_end_tag($parser, $name)
{
$name = explode($this->delimiter, $name);
$name = count($name) == 1 ? array('', $name[0]) : $name;
//echo "depth ".$this->depth.", $name[1] tag ended".PHP_EOL.PHP_EOL;
if ($this->depth == 1) {
if ($this->end_cb) {
$stanza = new JAXLXml($name[1], $this->ns);
call_user_func($this->end_cb, $stanza);
}
} elseif ($this->depth > 1) {
if ($this->stanza) {
$this->stanza->up();
}
if ($this->depth == 2) {
if ($this->stanza_cb) {
call_user_func($this->stanza_cb, $this->stanza);
$this->stanza = null;
}
}
}
--$this->depth;
}