Skip to main content

Web checklist

Checkpoint 4.1a: *WCAG 2.0* Parsing

In content implemented using markup languages, elements have complete start and end tags, elements are nested according to their specifications, elements do not contain duplicate attributes, and any IDs are unique, except where the specifications allow these features.

On this page:



Rationale

In order for user agents such as screen readers to accurately interpret content, the Web site must use correct markup. If the markup of the content is ambiguous, then it may be interpreted differently by different screen readers and the content will not be accessible.

Because there are industry standards for the markup languages used on the Web such as HTML and XHTML, many Web checking tools can automatically verify that Web pages follow standard markup guidelines. This makes it easier to identify and correct potential parsing problems.

Required development techniques

Compliance with this checkpoint requires at least one of the following techniques to be met. These techniques are defined in the Level A Success Criterion for guideline 4.1.1 from the WCAG 2.0 checklist (link resides outside of ibm.com).

  1. Parsed: Ensure that Web pages can be parsed unambiguously.
  2. Validate: Validate Web pages.
  3. Conform: Fully conform to specifications.

Examples for general developers

For techniques that have no technology-specific examples, refer to the HTML example section for guidance.

1. Parsed: Ensure that Web pages can be parsed unambiguously.

There are no specific examples for general developers.

2. Validate: Validate Web pages.

Web checking tools can verify that a Web page validates against HTML standards for valid markup. Using correct markup helps ensure that the content will be available to assistive technologies.

To comply with this technique, at least one of the following examples must be implemented.

Example 1

Use a Web syntax analyzer to validate the Web page against HTML coding standards. For more examples of this technique, refer to WCAG 2.0 examples for validating Web pages (link resides outside of ibm.com).

3. Conform: Fully conform to specifications.

When markup languages are used in a way that fully conforms to their specifications, all of the requirements for this checkpoint are met. Therefore, while this technique is not always required but, it is a best practice, and if met, is one way to satisfy this checkpoint.

To verify that your pages fully conform to specifications, run your code through an automated validator and ensure that all specification errors are corrected.

For more examples of this technique, refer to WCAG 2.0 examples for using HTML according to spec (link resides outside of ibm.com).


Examples for HTML developers

For techniques that have no technology-specific examples, refer to the general example section for guidance.

1. Parsed: Ensure that Web pages can be parsed unambiguously.

To comply with this technique, at least one of the following examples must be implemented.

Example 2

Ensure that opening and closing tags are used according to specification and ensure that Web pages are well-formed and that a DOCTYPE is added to your document.

Use correct markup to ensure that assistive technology can accurately parse the content. The following example shows the correct use of unique id attributes in table markup. Note that closing tags are also added for all elements.

<tr>
<th id="cp1"><a name="Checkpoint1">1</a></th>
<td headers="cp1">Images and animations. Use the alt attribute to provide text equivalents for images.</td>
</tr>
<tr>
<th id="cp2"><a name="checkpoint2">2</a></th>
<td headers="cp2">Image maps. Use client-side image maps and alternative text for image map hot spots.</td>
</tr>

Example 3

The following example shows the same code sample before and after closing tags were added. Closing tags must be used so that the code can be parsed accurately.

<img id="logo" src="mylogo.jpg" alt="My logo"> - incorrect
<img id="logo" src="mylogo.jpg" alt="My logo" /> - correct


See WCAG 2.0 examples for ensuring that opening and closing tags are used according to specification (link resides outside of ibm.com).

Example 4

To ensure that Web pages are well formed, ensure that all id attribute values are unique for the document and that the Web page is well-formed. The W3C Spec for XML 1.1 (link resides outside of ibm.com) defines the criteria for well-formed XML content and a conforming XML parser can validate XML content against that criteria. Ensuring all id attribute values are unique is one criteria for meeting well-formed constraints.

Example 5

Use a valid DOCTYPE statement so validation programs can know what version of HTML or XHTML is used for the Web page.

For example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


See the WCAG 2.0 examples for ensuring that Web pages are well-formed (link resides outside of ibm.com).

2. Validate: Validate Web pages.

There are no specific examples for HTML developers.

3. Conform: Fully conform to specifications.

There are no specific examples for HTML developers.

Required test techniques

The following test tools and techniques are required to test this checkpoint.

  1. Test tools
  2. Required accessibility verification test techniques

Test tools:

Install the following tools to test this checkpoint:

Required accessibility verification test techniques:

Use the following accessibility verification test (AVT) techniques to validate the Web content. It is recommended that these tests be performed in order.

1. Web syntax analyzer test:
Action Result

Test the Web site with a Web syntax analyzer to verify the compliance criteria as follows

Pass:

Fail:

2. Manual test:
Action Result

Verify the compliance criteria for this technique as follows.

Pass:

Fail:

©2009 IBM Corporation

Last updated September 1, 2009

W3C Recommendation 11 December 2008: http://www.w3.org/TR/WCAG20/ (link resides outside of ibm.com)
Consortium for Informatics and Mathematics, Keio University), All Rights Reserved.