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

Received on Monday, 23 August 1999 14:54:00 UTC