Re: HTML and end tags

Dave_Raggett <dsr@hplb.hpl.hp.com>
From: Dave_Raggett <dsr@hplb.hpl.hp.com>
Message-id: <9401071805.AA08315@manuel.hpl.hp.com>
Subject: Re:  HTML and end tags
To: koblas@netcom.com
Date: Fri, 7 Jan 94 18:05:23 GMT
Cc: www-talk@www0.cern.ch
Mailer: Elm [revision: 66.36.1.1]
Content-Length: 871
> So at the very least this brings up the question of what is
> the meaning of the following:

>        <PRE>
>        <A HREF=reference>this is some text
>        <A NAME=here>that is all</A>
>        an anchor.</A>
>        </PRE>

In my parser, the second <A> start tag automatically terminates the
first since anchors can't be nested, so the above is equivalent to:

        <PRE>
        <A HREF=reference>this is some text
        </A><A NAME=here>that is all</A>
        an anchor.</A>
        </PRE>

The DTD *REQUIRES* the closing tag, but my topdown parser knows what elements
are permitted in any context and hence can easily insert missing tags.

It doesn't handle <A HREF="..."><H1>some text</H1></A> very well, though,
as it sees an empty anchor, then a little later an unexpected </A> tag
which it ignores, but you can't win all the time ...

Dave Raggett