void flushBuffer(final IMarkupHandler handler, final boolean autoOpen) throws ParseException {

        if (this.standalone) {
            handler.handleStandaloneElementStart(
                    this.elementName, 0, this.elementNameLen, this.minimized, this.elementNameLine, this.elementNameCol);
        } else if (autoOpen) {
            handler.handleAutoOpenElementStart(
                    this.elementName, 0, this.elementNameLen, this.elementNameLine, this.elementNameCol);
        } else {
            handler.handleOpenElementStart(
                    this.elementName, 0, this.elementNameLen, this.elementNameLine, this.elementNameCol);
        }

        for (int i = 0; i < this.attributeCount; i++) {

            handler.handleInnerWhiteSpace(
                    this.elementInnerWhiteSpaceBuffers[i],
                    0, this.elementInnerWhiteSpaceLens[i],
                    this.elementInnerWhiteSpaceLines[i], this.elementInnerWhiteSpaceCols[i]);

            handler.handleAttribute(
                    this.attributeBuffers[i],
                    0, this.attributeNameLens[i], this.attributeNameLines[i], this.attributeNameCols[i],
                    this.attributeNameLens[i], this.attributeOperatorLens[i], this.attributeOperatorLines[i], this.attributeOperatorCols[i],
                    this.attributeValueContentOffsets[i], this.attributeValueContentLens[i],
                    this.attributeNameLens[i] + this.attributeOperatorLens[i], this.attributeValueOuterLens[i],
                    this.attributeValueLines[i], this.attributeValueCols[i]);
        }

        if (this.elementInnerWhiteSpaceCount - this.attributeCount > 0) {

            for (int i = this.attributeCount; i < this.elementInnerWhiteSpaceCount; i++) {

                handler.handleInnerWhiteSpace(
                        this.elementInnerWhiteSpaceBuffers[i],
                        0, this.elementInnerWhiteSpaceLens[i],
                        this.elementInnerWhiteSpaceLines[i], this.elementInnerWhiteSpaceCols[i]);

            }

        }

        if (this.standalone) {
            handler.handleStandaloneElementEnd(
                    this.elementName, 0, this.elementNameLen, this.minimized, this.elementEndLine, this.elementEndCol);
        } else if (autoOpen) {
            handler.handleAutoOpenElementEnd(
                    this.elementName, 0, this.elementNameLen, this.elementEndLine, this.elementEndCol);
        } else {
            handler.handleOpenElementEnd(
                    this.elementName, 0, this.elementNameLen, this.elementEndLine, this.elementEndCol);
        }

    }