W3C home > Mailing lists > Public > www-validator@w3.org > August 2004

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

From: Frank Ellermann <nobody@xyzzy.claranet.de>
Date: Tue, 03 Aug 2004 00:40:50 +0200
To: www-validator@w3.org
Message-ID: <410EC2F2.4D11@xyzzy.claranet.de>

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

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:08 UTC