@Override
    public void endDocument() throws SAXException {
        switch (state) {
            case AWAITING_ELEMENT_DL:
            case AWAITING_HEADING:
                // XXX finish
                break;
            case IN_H4:
            case IN_CODE_IN_H4:
            case IN_ELEMENT_DL_START:
            case IN_CATEGORIES_DT:
            case IN_CONTEXT_DT:
            case IN_CONTENT_MODEL_DT:
            case IN_TAG_OMISSION_DT:
            case IN_ATTRIBUTES_DT:
            case CAPTURING_CATEGORIES_DDS:
            case CAPTURING_CONTEXT_DDS:
            case CAPTURING_CONTENT_MODEL_DDS:
            case CAPTURING_TAG_OMISSION_DDS:
            case CAPTURING_ATTRIBUTES_DDS:
                throw new SAXException(
                        "Malformed spec: Wrong state for document end.");
        }
    }
@see org.xml.sax.ContentHandler#characters(char[], int, int)
src/nu/validator/spec/html5/Html5SpecBuilder.java