This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Duplicated use of an anchor name cannot be detected. For example, it passes the HTML code below: <a name="top">Anchor 1</a> <a name="top">Anchor 2</a>
(In reply to comment #0) > Duplicated use of an anchor name cannot be detected. > For example, it passes the HTML code below: > > <a name="top">Anchor 1</a> > <a name="top">Anchor 2</a> the "name" attribute is of type name, which means that unlike the "id" attribute, the name attribute has no constraint of uniqueness. As a result, the above is valid, and the validator parses it as such. In an attempt at usefulness, one could imagine that the validator could throw a warning when detecting a duplicate name attribute. I am changing the bug title to show this idea, and marking it as enhancement request. Note that in XHTML, the name attribute is deprecated. http://www.w3.org/TR/xhtml1/#h-4.10 The HTML compatibility guidelines recommend to use name="foo" id="foo". This recommendation is also a good idea for HTML4. http://www.w3.org/TR/xhtml1/#C_8
s/warning/error since it violates HTML conformance requirements. I've implemented checks for this long ago in HTML Tidy...