Re: Suggestion

From: Jukka.Korpela@hut.fi
Date: Mon, Aug 23 1999


From: Jukka.Korpela@hut.fi
Date: Mon, 23 Aug 1999 21:53:55 +0300 (EET DST)
To: www-validator@w3.org
Message-ID: <Pine.OSF.4.10.9908232147580.30325-100000@beta.hut.fi>
Subject: Re: Suggestion

On Mon, 23 Aug 1999, Martin Manscher wrote:

> Suggestion: There could be an explanation for the error "document type
> does not allow element "A" here". The reason seems to be (at least most
> often) that nesting of "A" tags is not allowed. 

It can be caused my many different ways of nesting elements wrongly.
But admittedly the reason you mention is a common one (occurred to
me today...).

It's mainly a matter of the overall structure of a validator:
how easily can it analyze the enclosing document tree to see
"where we are" when it encounters an error? Surely it would be
nice if it checked that there is an unclosed A element open when
it encounters an <a ...> start tag, so that it could give a dedicated
error message. But it really depends on how the validator has been
coded, and I'm afraid they have simple parsers which don't carry
much contextual information.

> PS: Why does it seem that <H2> tags etc. is not allowed within an <A NAME>
> tag? (in html 4.0) 

That's simpler: because it isn't, by HTML syntax. It was that way
already in HTML 2.0. You need to nest those elements the other way
(A inside H2, which is logical in the sense that A is text level,
H2 is block level). 

-- 
Yucca, http://www.hut.fi/u/jkorpela/ or http://yucca.hut.fi/yucca.html