W3C home > Mailing lists > Public > www-validator@w3.org > September 2007

Re: Passed validation with wrong markup....

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Tue, 4 Sep 2007 16:15:19 +0300 (EEST)
To: www-validator@w3.org
cc: "NOWAR.MEANS.PEACE@GMAIL.com" <nowar.means.peace@gmail.com>
Message-ID: <Pine.SOC.4.64.0709041609200.17569@hopeatilhi.cs.tut.fi>

On Tue, 4 Sep 2007, David Dorward wrote:

>> So why is it that the w3c validator gives a passed validation for a sloppy 
>> code?
> Because, in HTML, the value of the href attribute is allowed to contain 
> backslash characters. It might not mean what was intended, but that doesn't 
> make it invalid.

There are two meanings for "allowed" that are relevant here.

The formal syntax (DTD) of HTML basically allows any characters inside an 
href attribute value, since the attribute is declared as CDATA (character 
data). This is what matters in validation.

The prose of HTML specifications may impose further restrictions on such 
attribute values. Such restrictions are not covered in validation.

The restrictions can be indirect. The href attribute value is a URL (or 
"URI"), so what's "allowed" there - in a sense that is irrelevant to 
validation but quite relevant otherwise - depends on the URL 
specifications. The "\" character used to be disallowed, but current URL 
specification allows it - though _not_ as a synonym for "/".

Checking href attribute values is something quite different from markup 
validation. You can use a link checker for the purpose, though it probably 
checks that the URL "works" rather than its syntactic correctness.

Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Tuesday, 4 September 2007 13:15:32 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:53 UTC