4.1.1 Parsing success criterion of WCAG 2.0 says
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. (Level A).
Note: Start and end tags that are missing a critical character in their formation, such as a closing angle bracket or a mismatched attribute value quotation mark are not complete.
Description for 4.1.1 Parsing
User agents including assistive technologies rely on markup for rendering the content on a web page. Poorly coded markup that is not semantic or have significant errors may lead to wrongly interpreting the content on user agents including assistive technologies.
Providing a clean and semantic markup is always good. However 4.1.1 Parsing success criterion of WCAG 2.0 specifically emphasize on four parsing errors.
- Elements have complete start and end tags
- elements are nested according to their specifications,
- elements do not contain duplicate attributes,
- any IDs are unique.
Elements have complete start and end tags
On a web page, a level 3 heading and its associated content have same font size. The content author has not provided an end heading tag i.e. </h3>. Screen reader will read the heading and its associated paragraph as a level 3 heading content. Screen reader users will not be able to differentiate the heading and the content. If an <a> is not ended properly the next line or sentence may be identified as a link by screen readers.
elements are nested according to their specifications
Elements that allow nesting, e.g.: lists and tables must be marked up properly. If the nesting is improper meaning of the entire content may change. For instance where an unordered list have 3 items named Fruits, vegetables and drinks. Each of these list items have sub items nested list in this case. If the nested list of Fruits that contains apple, mango, banana is not properly closed or nested, the nest main list item Vegetables and its sub items will be read as sub items of fruits. This will cause the change in meaning.
elements do not contain duplicate attributes
Elements must not have duplicate attributes. e.g. an image must not have 2 alt attributes, an text field must not have two title attributes etc. Most of the modern user agents intelligently remove any duplicate attributes but which of them is removed is an unanswered question. At least I am not aware of it. So if you inspect the DOM you don’t find duplicate attributes. Even the automation tools that spider the DOM for accessibility violations also do not catch the problem of duplicate attributes. Those tools which retrieve the source code such as W3C validator will be able to identify the problems.
any IDs are unique.
On a given web page the Id value must be unique in each instance it is used. e.g. If a page has two text fields first name and last name, providing id=”name” for both the fields is a failure as per 4.1.1 parsing success criterion. On the other hand when screen readers encounter them, the label association that is announced will cause problem. Birkir Gunnarson have written a great article Why unique Ids matter is worth reading. Almost all the automation tools and validation tools throw this errors.
Validating for 4.1.1 Parsing
Due to the complexity involved it is tough to manually identify all the violations of 4.1.1 parsing. Many validation tools are available online but they throw all the validation errors many of which are not 4.1.1 parsing errors. One method is to validate with tools such as W3C validation service and manually grade violations specific to 4.1.1 parsing. The other one is to use Steve falkners bookmarklet and W3C NU validation service. Read the article by Steve Falkner to understand how to use W3C NU validator and bookmarklet.