JAXLXmlStream::handle_start_tag PHP Méthode

handle_start_tag() protected méthode

protected handle_start_tag ( $parser, $name, array $attrs )
$attrs array
    protected function handle_start_tag($parser, $name, array $attrs)
    {
        $name = $this->explode($name);
        //echo "start of tag ".$name[1]." with ns ".$name[0].PHP_EOL;
        // replace ns with prefix
        foreach ($attrs as $key => $v) {
            $k = $this->explode($key);
            // no ns specified
            if ($k[0] == null) {
                $attrs[$k[1]] = $v;
            } elseif ($k[0] == XMPP::NS_XML) {
                // xml ns
                unset($attrs[$key]);
                $attrs['xml:' . $k[1]] = $v;
            } else {
                JAXLLogger::error("==================> unhandled ns prefix on attribute");
                // remove attribute else will cause error with bad stanza format
                // report to developer if above error message is ever encountered
                unset($attrs[$key]);
            }
        }
        if ($this->depth <= 0) {
            $this->depth = 0;
            $this->ns = $name[1];
            if ($this->start_cb) {
                $stanza = new JAXLXml($name[1], $name[0], $attrs);
                call_user_func($this->start_cb, $stanza);
            }
        } else {
            if (!$this->stanza) {
                $stanza = new JAXLXml($name[1], $name[0], $attrs);
                $this->stanza =& $stanza;
            } else {
                $this->stanza->c($name[1], $name[0], $attrs);
            }
        }
        ++$this->depth;
    }