Albert thinks for the push to share what I have found out.
Jerry identified an interesting issue; When 2 (or more) lines of code result in a warning the first line involved is not identified. The second and following lines each have a warning linked to them.
The following code can be cut-and-pasted into the validator to get the warning Jerry started this thread with.
<P>This code fragment
<A href="foo">illustrates</A>
the warnings received when code is validated with "Options", "Validator Engine Options...", "Enable Accessibility Checking" on.
</P>
<P>Adding different "title" attributes to each "a" element
<A href="foo2">illustrates</A>
the suggested method to distinguish between the links.
</P>
<P>For example, if the link text is the same but resources are
<A title="different hrefs" href="foo3">different</A>
and the title attributes are
<A title="different titles" href="foo4">different</A>
then no warning is generated.
</P>
The Warning -- [Web Content Accessibility Guidelines 1.0 (Priority 2)]
The link text "illustrates" has already been used to link to a different resource (foo). If more than one link on a page shares the same link text, then those links should point to the same resource. If two or more links refer to different resources but share the same link text, then specify different values for the "title" attribute of the "a" element to distinguish the links. [P2, 13.1]
--
The warning(s) highlights the second or following "a" tag(s) but where is the first one? The clues are the resource (foo) or the link text, either of which can be entered into the search tool (Ctrl+F) to find the first "a" tag with the same link text that needs a "title" attribute.
I could not duplicate that the warning can be resolved with only one "title".
To add a warning for the first "a" tag would require a two-pass parser, not a practical resolution IMHO. (There is nothing wrong with the first "a" tag until the second one is reached. By then it is to late to link a warning to the first line of code.)
I suggest:
1) Change the warning to make it clearer that each "a" tag needs a unique "title" attribute: "...then specify different values for the "title" attribute FOR EACH of the "a" elementS USING THE SAME LINK TEXT to distinguish the links. [P2, 13.1]"
2) Add the line number of the first use of the link text, for example: "...already been used to link to a different resource (foo) (line xx)."