This page lists a few test documents and test scenarios for the W3C Markup Validator make sure everything works fine after making changes to the validator. If you can think of interesting test cases that aren't on this page, let us know.
This test suite is work in progress. Please submit any issue or idea to the public mailing-list public-qa-dev@w3.org
do not edit this page, it is automatically generated from the validator's automated test suite. If you want to add tests, edit the test suite's catalog instead.
validate - with v.w.o - view: Valid HTML 2.0 sample document.
validate - with v.w.o - view: Valid HTML 2.0 Strict sample document.
validate - with v.w.o - view: Valid HTML 4.0 Strict sample document.
validate - with v.w.o - view: Valid HTML 4.0 Transitional sample document.
validate - with v.w.o - view: Valid HTML 4.0 Frameset sample document.
validate - with v.w.o - view: Valid HTML 4.01 Strict sample document.
validate - with v.w.o - view: Valid HTML 4.01 Transitional sample document - (from the HTML 4.01 PR)
validate - with v.w.o - view: Valid HTML 4.01 Transitional sample document. - with iframe element (test for
validate - with v.w.o - view: HTML5 sample document.
validate - with v.w.o - view: Valid ISO-HTML (aka ISO/IEC 15445:2000) sample document.
validate - with v.w.o - view: Valid XHTML 1.0 Strict sample document
validate - with v.w.o - view: Valid XHTML 1.0 Strict (from XHTML Spec) sample document.
validate - with v.w.o - view: Valid XHTML Basic 1.0 sample document.
validate - with v.w.o - view: Valid XHTML Basic 1.1 sample document.
validate - with v.w.o - view: W3C home page as XHTML 1.1 Basic. Should be valid but may not validate with the old REC versions of the DTD (would not like the class and style attributes)
validate - with v.w.o - view: XHTML MP 1.2
validate - with v.w.o - view: XHTML 1.1
validate - with v.w.o - view: Valid XHTML/MathML2 sample document (with FPI)
validate - with v.w.o - view: Valid MathML 2.0 minimal test document
validate - with v.w.o - view: Valid XHTML 1.1 sample document, served as application/xhtml+xml
validate - with v.w.o - view: Valid SMIL 1.0 minimal document
validate - with v.w.o - view: Valid SMIL 2.0 sample document.
validate - with v.w.o - view: Valid SMIL 2.1 sample document.
validate - with v.w.o - view: Valid SMIL 2.1 Mobile sample document.
validate - with v.w.o - view: Valid XHTML + MathML + SVG sample document (from the 9 August 2002 WD)
validate - with v.w.o - view: Valid XHTML-Print sample document.
validate - with v.w.o - view: Valid SVG 1.0 Rec. minimal document
validate - with v.w.o - view: Valid SVG 1.1 Rec. minimal document
validate - with v.w.o - view: Valid SVG Tiny 1.1 sample document.
validate - with v.w.o - view: Valid XHTML + RDFa sample document.
validate - with v.w.o - view: HTML4.0 plus blink ("Custom" SGML DTD)
validate - with v.w.o - view: RDDL (with FPI)
validate - with v.w.o - view: RDDL (no FPI)
validate - with v.w.o - view: sample MusicXML, a non-catalogued XML based document type. (also test for
validate - with v.w.o - view: Valid SVG 1.0, using a DOCTYPE
validate - with v.w.o - view: Valid SVG 1.0, but no declared DOCTYPE. Version attribute present for auto-detection
validate - with v.w.o - view: Valid SVG 1.1, using a DOCTYPE
validate - with v.w.o - view: Valid SVG 1.1, no declared DOCTYPE. Version attribute present for auto-detection.
validate - with v.w.o - view: Valid SVG Basic 1.1, using a DOCTYPE (test currently fails because of issues in the DTD)
validate - with v.w.o - view: Valid SVG Basic 1.1, no declared DOCTYPE. Version and baseProfile attributes present for auto-detection. (test currently fails because of issues in the DTD)
validate - with v.w.o - view: Valid SVG Tiny 1.1, using a DOCTYPE
validate - with v.w.o - view: Valid SVG Tiny 1.1, no declared DOCTYPE. Version and baseProfile attributes present for auto-detection.
validate - with v.w.o - view: Valid SVG 1.1, using a DOCTYPE. No version attribute (optional). Should use info given by doctype.
validate - with v.w.o - view: Valid SVG 1.0, using a DOCTYPE. No version attribute (optional). Should use info given by doctype.
validate - with v.w.o - view: SVG with neither DOCTYPE nor version attribute. The validator may use a default.
validate - with v.w.o - view: Reference to a non-existing ID (opensp message type X, See
validate - with v.w.o - view: Non-SGML Chars
validate - with v.w.o - view: HTML 4.01 Document with Ampersand as data
validate - with v.w.o - view: document served as
validate - with v.w.o - view: FPI/SI doctype declaration mismatch (system Id refers to a 404)
validate - with v.w.o - view: FPI/SI doctype declaration mismatch (html 4 doc with system Id refers to xhtml)
validate - with v.w.o - view: FPI/SI doctype declaration mismatch (system Id is OK but FPI has wrong case)
validate - with v.w.o - view: sample HTML 4 document using the (valid, but problematic) shorttags features
validate - with v.w.o - view: sample HTML5 document using a construct that should pass checking, with a warning output.
validate - with v.w.o - view: C1: XML Declaration
validate - with v.w.o - view: C2: empty elements and minimized form
validate - with v.w.o - view: C3: Element Minimization and Empty Element Content
validate - with v.w.o - view: HTML 4.01 Strict served with an XHTML mime type. This should fail validation since the media type forces the XML parsing mode
validate - with v.w.o - view: SVG 1.0 Rec. minimal document served as text/html. This may pass validation with a warning as text/html will not trigger an unambiguous parsing mode, and doctype will prevail. (is that wrong?)
validate - with v.w.o - view: MathML 2.0 as text/html This may pass validation with a warning as text/html will not trigger an unambiguous parsing mode, and doctype will prevail. (is that wrong?)
validate - with v.w.o - view: XHTML+Math+SVG document with non-unix newlines, (See
validate - with v.w.o - view: XHTML with named entities on a line with colons and numbers, caused bogus error report in validator 0.8.0 (See
validate - with v.w.o - view: XHTML1, bogus element (foo element not in DTD)
validate - with v.w.o - view: XHTML1, bogus attribute
validate - with v.w.o - view: Testing fuzzy matching: typos in attribute and element, and wrong-cased attribute and element.
validate - with v.w.o - view: HTML5 document with tokenizer error (precise locator)
validate - with v.w.o - view: HTML5 document with Tree builder (range locator)
validate - with v.w.o - view: HTML5 document with bogus attribute (should have an error explanation)
validate - with v.w.o - view: XHTML1, bogus element (uppercase A element not in DTD), tends to cascade errors about each attribute
validate - with v.w.o - view: us-ascii xhtml document with a latin1 character
validate - with v.w.o - view: Invalid document (img without alt, invalid
validate - with v.w.o - view: invalid frames document (noframes in forbidden location). Also test for absence of newlines
validate - with v.w.o - view: HTML 4.01 Strict - with iframe element (test for
validate - with v.w.o - view: XHTML1, blank first line (
validate - with v.w.o - view: Bug
validate - with v.w.o - view: XHTML with bogus XML Decl, served as application/xhtml+xml (missing final "?")
validate - with v.w.o - view: XHTML with bogus XML Decl, served as text/html (missing final "?")
validate - with v.w.o - view: bogus FPI #1: lowercase "doctype".
validate - with v.w.o - view: SMIL 2.0 with bogus xmlns and missing space between attributes
validate - with v.w.o - view: SMIL 2.0 with bogus xmlns, xml ill-formedness and bogus elements (used to test sorting of errors)
validate - with v.w.o - view: XHTML 1.0 missing space between attributes (
validate - with v.w.o - view: XHTML, no DOCTYPE, no xmlns (thus invalid)
validate - with v.w.o - view: XHTML, no DOCTYPE, has xmlns (served as application/xhtml+xml)
validate - with v.w.o - view: XHTML, no DOCTYPE, has xmlns (served as application/xhtml+xml)
validate - with v.w.o - view: XML, no DOCTYPE, not well-formed (marked as "invalid XML" - FIXME should be reworded)
validate - with v.w.o - view: SGML-ish document without html root. Served as text/html. No DOCTYPE. Correct SGML syntax. Would pass as well-formed XML if it were XML...
validate - with v.w.o - view: SGML-ish document without html root. Served as text/html. No DOCTYPE. Bogus SGML syntax.
validate - with v.w.o - view: XHTML 1.0 Strict missing xmlns attribute (valid)
validate - with v.w.o - view: bogus FPI #2: HTML 4.01 "Strict"
validate - with v.w.o - view: bogus FPI #3: XHTML 1.1 "Strict"
validate - with v.w.o - view: Basic XML document, well formed. No doctype. Currently checked only for xmlwf. Passes.
validate - with v.w.o - view: XML output from OpenOffice 5.2 ("Build/Tag number OpenOffice605"), many namespaces. Currently checked only for xmlwf. Passes.
validate - with v.w.o - view: Very minimal SVG document, no document type. Currently checked only for xmlwf. Passes.
validate - with v.w.o - view: XHTML document without doctype, served as XML. Fallback to XHTML 1.0, and invalid.
validate - with v.w.o - view: iso-2022-jp encoded document
validate - with v.w.o - view: windows-1250 encoded document (Slovenian)
validate - with v.w.o - view: Another windows-1250 encoded document (Valid XHTML)
validate - with v.w.o - view: utf-8 encoded document
validate - with v.w.o - view: XML file with a "Plane 20" character (bogus).
validate - with v.w.o - view: Charset mismatch: HTTP Content-Type and XML Declaration (sends warning, proceed with HTTP and pass)
validate - with v.w.o - view: Charset mismatch: HTTP Content-Type and meta http-equiv (sends warning, proceed with HTTP and pass)
validate - with v.w.o - view: iso-8859-1 HTML document with charset declared in meta, (test for
validate - with v.w.o - view: iso-8859-1 HTML document with charset not declared in meta (nor in HTTP), (test for
validate - with v.w.o - view: This is a test for
validate - with v.w.o - view: DOCTYPE with a relative URI for the system identifier. Should probably pass if the sgml parser was given the base URI(?)
validate - with v.w.o - view: text/xml, no charset (W01)
validate - with v.w.o - view: text/html, no charset, fbc set (W02)
validate - with v.w.o - view: charset override (W03)
validate - with v.w.o - view: text/html, no charset, override set (W04)
validate - with v.w.o - view: text/html, no charset (W04)
validate - with v.w.o - view: XHTML, no DOCTYPE, if overriden, should output W05.
validate - with v.w.o - view: HTML4.0 plus blink ("Custom" SGML DTD), parse mode fallback to SGML (W06)
validate - with v.w.o - view: HTML 4.01 Strict served with an XHTML mime type. Parse mode conflict (W07)
validate - with v.w.o - view: XHTML, no DOCTYPE, no xmlns (thus invalid). (W09).
validate - with v.w.o - view: XML, no DOCTYPE, not well-formed (W09xml)
validate - with v.w.o - view: XHTML. If using doctype override to HTML401, namespace will trigger (W11)
validate - with v.w.o - view: HTML 4.01 with xmlns attribute on root element. Should trigger a validation error (it does) and preparse warning W11 (it doesn't!)
validate - with v.w.o - view: HTML 4.01 Strict, validated with HTML 4.01 Transitional override (W13)
validate - with v.w.o - view: No doctype, override given, fallback fbd is off (W15)
validate - with v.w.o - view: No doctype, fallback given (W16)
validate - with v.w.o - view: charset mismatch HTTP / XML decl (W18)
validate - with v.w.o - view: charset mismatch HTTP / Meta (W19)
validate - with v.w.o - view: MathML 2.0 as text/html (W23)
validate - with v.w.o - view: supported, but rare, charset (W24)
validate - with v.w.o - view: SVG with neither DOCTYPE nor version attribute (OK in SVG). (W25)
The following test collections are not managed by the automated test suite, and should be tested by hand on a regular basis
The following tests do not test the binary "validity" results, but the proper handling of options, errors, various outputs, etc. "validate" links use this instance, with validator.w3.org links added for reference comparison
These should be tied to a bug report on either mailing-list and/or bugzilla whenever possible.