Re: </A> flagged as illegal when previois "" missing

On Sat, 7 Apr 2007, Peter Bauer wrote:

> This is flagged with Error 'end tag for element "A" which is not open.'
> <p><A HREF=http://thomer.com/vi/vi.html><img src=vi.powered.gif 
> ALT="vi"></A>

Technically, the error message is correct, though quite confusing.

> The following is accepted by the validator
> <p><A HREF="http://thomer.com/vi/vi.html"><img src=vi.powered.gif 
> ALT="vi"></A>
>
> So I understand that the error is the absence of the "" around the url...

In practical terms, that's right.

However, from the formal point of view - which is all that matters to a 
validator, by definition - the situation is quite different. Obviously you 
are using an HTML 4.01 document type. Then quotation marks may be omitted 
around attribute values in some cases. The validator reads

<p><A HREF=http:/

and everything is formally correct up to that point, since if http: were 
the attribute value, quotation marks would not be needed. Then comes the 
solidus (slash). By HTML 4.01 rules, ignored (in this issue) by almost all 
browsers, but by definition imposed by validators, the solidus in this 
context terminates the <a ...>...</a> element! Therefore, the subsequent 
</A> is an error.

For a more detailed explanation, see the Saga of the Slashed Validators,
http://www.cs.tut.fi/~jkorpela/qattr.html

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Sunday, 8 April 2007 17:39:58 UTC