@Override
    public void endElement(String uri, String localName, String name)
            throws SAXException {
        if ("http://www.w3.org/1999/xhtml" != uri) {
            return;
        }
        if (nonWhitespaceCharacterCount < MAX_CHARS) {
            documentContent.append(elementContent);
            elementContent.setLength(0);
        }
        if ("body".equals(localName)) {
            inBody = false;
            currentOpenElementsWithSkipName = 0;
        }
        if (currentOpenElementsInDifferentLang > 0) {
            currentOpenElementsInDifferentLang--;
            if (currentOpenElementsInDifferentLang < 0) {
                currentOpenElementsInDifferentLang = 0;
            }
        } else {
            if (Arrays.binarySearch(SKIP_NAMES, localName) >= 0) {
                currentOpenElementsWithSkipName--;
                if (currentOpenElementsWithSkipName < 0) {
                    currentOpenElementsWithSkipName = 0;
                }
            }
        }
    }
@see nu.validator.checker.Checker#endElement(java.lang.String,
     java.lang.String, java.lang.String)
src/nu/validator/checker/LanguageDetectingChecker.java