endTag example

// When we are on a void tag, we do not need to care about namesapce nesting,         // but we have to remove the namespaces pushed to $nsStack.         if ($pushes > 0 && Elements::isA($name, Elements::VOID_TAG)) {
            // remove the namespaced definded by current node             for ($i = 0; $i < $pushes; ++$i) {
                array_shift($this->nsStack);
            }
        }

        if ($selfClosing) {
            $this->endTag($name);
        }

        // Return the element mask, which the tokenizer can then use to set         // various processing rules.         return Elements::element($name);
    }

    public function endTag($name)
    {
        $lname = $this->normalizeTagName($name);

        
// Any buffered text data can go out now.             $this->flushBuffer();

            $tok = $this->scanner->next();

            if (false === $tok) {
                // end of string                 $this->parseError('Illegal tag opening');
            } elseif ('!' === $tok) {
                $this->markupDeclaration();
            } elseif ('/' === $tok) {
                $this->endTag();
            } elseif ('?' === $tok) {
                $this->processingInstruction();
            } elseif ($this->is_alpha($tok)) {
                $this->tagName();
            } else {
                $this->parseError('Illegal tag opening');
                // TODO is this necessary ?                 $this->characterData();
            }

            $tok = $this->scanner->current();
        }
Home | Imprint | This part of the site doesn't use cookies.