@Override protected void errQuoteOrLtInAttributeNameOrNull(char c) throws SAXException { if (c == '<') { err("\u201C<\u201D in attribute name. Probable cause: \u201C>\u201D missing immediately before."); } else if (c != '\uFFFD') { err("Quote \u201C" + c + "\u201D in attribute name. Probable cause: Matching quote missing somewhere earlier."); } }
@Override protected void errBadCharBeforeAttributeNameOrNull(char c) throws SAXException { if (c == '<') { err("Saw \u201C<\u201D when expecting an attribute name. Probable cause: Missing \u201C>\u201D immediately before."); } else if (c == '=') { errEqualsSignBeforeAttributeName(); } else if (c != '\uFFFD') { errQuoteBeforeAttributeName(c); } }
@Override protected void errBadCharBeforeAttributeNameOrNull(char c) throws SAXException { if (c == '<') { err("Saw \u201C<\u201D when expecting an attribute name. Probable cause: Missing \u201C>\u201D immediately before."); } else if (c == '=') { errEqualsSignBeforeAttributeName(); } else if (c != '\uFFFD') { errQuoteBeforeAttributeName(c); } }
@Override protected void errQuoteBeforeAttributeName(char c) throws SAXException { err("Saw \u201C" + c + "\u201D when expecting an attribute name. Probable cause: \u201C=\u201D missing immediately before."); }
@Override protected void errHtml4XmlVoidSyntax() throws SAXException { if (html4) { err("The \u201C/>\u201D syntax on void elements is not allowed. (This is an HTML4-only error.)"); } }
@Override protected void maybeErrSlashInEndTag(boolean selfClosing) throws SAXException { if (selfClosing && endTag) { err("Stray \u201C/\u201D at the end of an end tag."); } }
@Override protected void errQuoteBeforeAttributeName(char c) throws SAXException { err("Saw \u201C" + c + "\u201D when expecting an attribute name. Probable cause: \u201C=\u201D missing immediately before."); }
@Override protected void errBadCharAfterLt(char c) throws SAXException { err("Bad character \u201C" + c + "\u201D after \u201C<\u201D. Probable cause: Unescaped \u201C<\u201D. Try escaping it as \u201C<\u201D."); }
@Override protected void errQuoteOrLtInAttributeNameOrNull(char c) throws SAXException { if (c == '<') { err("\u201C<\u201D in attribute name. Probable cause: \u201C>\u201D missing immediately before."); } else if (c != '\uFFFD') { err("Quote \u201C" + c + "\u201D in attribute name. Probable cause: Matching quote missing somewhere earlier."); } }
@Override protected void maybeErrSlashInEndTag(boolean selfClosing) throws SAXException { if (selfClosing && endTag) { err("Stray \u201C/\u201D at the end of an end tag."); } }
@Override protected void errQuoteOrLtInAttributeNameOrNull(char c) throws SAXException { if (c == '<') { err("\u201C<\u201D in attribute name. Probable cause: \u201C>\u201D missing immediately before."); } else if (c != '\uFFFD') { err("Quote \u201C" + c + "\u201D in attribute name. Probable cause: Matching quote missing somewhere earlier."); } }
@Override protected void errHtml4LtSlashInRcdata(char folded) throws SAXException { if (html4 && (index > 0 || (folded >= 'a' && folded <= 'z')) && ElementName.IFRAME != endTagExpectation) { err((stateSave == Tokenizer.DATA ? "CDATA" : "RCDATA") + " element \u201C" + endTagExpectation.name + "\u201D contained the string \u201C</\u201D, but it was not the start of the end tag. (HTML4-only error)"); } }
@Override protected void errHtml4NonNameInUnquotedAttribute(char c) throws SAXException { if (html4 && !((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '.' || c == '-' || c == '_' || c == ':')) { err("Non-name character in an unquoted attribute value. (This is an HTML4-only error.)"); } }
@Override protected void errBadCharAfterLt(char c) throws SAXException { err("Bad character \u201C" + c + "\u201D after \u201C<\u201D. Probable cause: Unescaped \u201C<\u201D. Try escaping it as \u201C<\u201D."); }
private void complainAboutNonAscii() throws SAXException { String encoding = null; if (encodingDeclarationHandler != null) { encoding = encodingDeclarationHandler.getCharacterEncoding(); } if (encoding == null) { err("The character encoding of the document was not explicit but the document contains non-ASCII."); } else { err("No explicit character encoding declaration has been seen yet (assumed \u201C" + encoding + "\u201D) but the document contains non-ASCII."); } }
@Override protected void maybeErrAttributesOnEndTag(HtmlAttributes attrs) throws SAXException { if (attrs.getLength() != 0) { /* * When an end tag token is emitted with attributes, that is a parse * error. */ err("End tag had attributes."); } }
/** * @see nu.validator.htmlparser.impl.Tokenizer#errAstralNonCharacter(int) */ @Override protected void errAstralNonCharacter(int ch) throws SAXException { err("Character reference expands to an astral non-character (" + toUPlusString(value) + ")."); }
/** * @see nu.validator.htmlparser.impl.Tokenizer#errAstralNonCharacter(int) */ @Override protected void errAstralNonCharacter(int ch) throws SAXException { err("Character reference expands to an astral non-character (" + toUPlusString(value) + ")."); }
/** * @see nu.validator.htmlparser.impl.Tokenizer#errAstralNonCharacter(int) */ @Override protected void errAstralNonCharacter(int ch) throws SAXException { err("Character reference expands to an astral non-character (" + toUPlusString(value) + ")."); }
@Override protected void maybeErrAttributesOnEndTag(HtmlAttributes attrs) throws SAXException { if (attrs.getLength() != 0) { /* * When an end tag token is emitted with attributes, that is a parse * error. */ err("End tag had attributes."); } }