public function onElementStart($name, $attributes) { $this->_xmlns = PHPTAL_Dom_XmlnsState::newElement($this->_xmlns, $attributes); foreach ($attributes as $key => $value) { if (!$this->_xmlns->isValidAttribute($key)) { $this->raiseError(self::ERR_UNSUPPORTED_ATTRIBUTE, $key); } } $node = new PHPTAL_Dom_Element($name, $attributes); $node->setXmlnsState($this->getXmlnsState()); $this->pushNode($node); array_push($this->_stack, $this->_current); $this->_current = $node; }