2.23 Create documents that validate to published formal grammars
WAI Checkpoint 3.2
Full WAI text: "Create documents that validate to published formal grammars."
An HTML document's mark-up must follow the rules which are set out in a formal set of mark-up declarations which are contained in a published formal grammar or Document Type Definition (DTD).
Documents that are created using published formal grammars will be supported by more browsers and assistive technologies.
Many accessibility features of assistive technology, accessible web technology, and web browsers rely on published formal grammars. Failing to work to a formal published grammar may make a web page directly inaccessible or inaccessible to assistive technologies like screen readers, Braille devices, etc. Writing code which validates to formal grammars also facilitates indexing tools, search engines, programs that extract tables to databases, navigation tools that use header elements and automatic text translation software.
Directions and Techniques
Include a document type declaration referring to a published DTD
Use the DOCTYPE statement as the first line of your HTML file for the particular grammar (e.g. the strict HTML 4.0 DTD) that the code adheres to.
Refer to the WAI recommended techniques for this guideline
See the WAI recommended techniques for creating documents that validate
How you could check for this:
Test with the W3C HTML validator
The W3C HTML validator can check HTML to ensure that it validates to formal grammars. The W3C also provide a comprehensive list of the formal grammars which it uses. Some authoring tools also include validators. If you use an authoring tool, you should ensure that the validator is up to date.