parseError example



        // Parse tag         if ('<' === $tok) {
            // 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->processor = $proc;
    }

    public function doctype($name$idType = 0, $id = null, $quirks = false)
    {
        // This is used solely for setting quirks mode. Currently we don't         // try to preserve the inbound DT. We convert it to HTML5.         $this->quirks = $quirks;

        if ($this->insertMode > static::IM_INITIAL) {
            $this->parseError('Illegal placement of DOCTYPE tag. Ignoring: ' . $name);

            return;
        }

        $this->insertMode = static::IM_BEFORE_HTML;
    }

    /** * Process the start tag. * * @todo - XMLNS namespace handling (we need to parse, even if it's not valid) * - XLink, MathML and SVG namespace handling * - Omission rules: 8.1.2.4 Optional tags * * @param string $name * @param array $attributes * @param bool $selfClosing * * @return int */
Home | Imprint | This part of the site doesn't use cookies.