Re: [Fwd: http://www.w3.org/TR/2004/WD-i18n-html-tech-char-20040509/]

Ian B. Jacobs wrote:
 
> Could you help with this question about whether
> <a name="foo"/> is valid xhtml 1.0 (I think it isn't)

http://www.w3.org/TR/2002/REC-xhtml1-20020801/#guidelines C.8:

| identical values may be supplied for both of these 
| attributes to ensure maximum forward and backward
| compatibility (e.g., <a id="foo" name="foo">...</a>).

The DTD can't express details like "hreflang= should be
only used if href= is present", or "at least one of href=
or id= is required", or "if name= is used its value must
match the value of id=".

> why the validator doesn't complain?

The validator uses the DTD, and the DTD doesn't specify
these details.  Something like <a hreflang="en">oops</a>
is probably valid w.r.t. the DTD.  And if that's the case
<a name="foo">bar</a> is also valid.

Just for fun I've just tested it, the validator accepts
this as valid.  Even for XHTML 1.0 strict.  Of course it
won't work for XHTML 1.1 => there is no attribute "name",
but the weird <a hreflang="en">oops</a> is still valid.

                 Bye, Frank

Received on Monday, 2 August 2004 18:41:46 UTC