Re: A's content model

Daniel W. Connolly (connolly@hal.com)
Wed, 21 Sep 94 20:03:13 EDT

In message <199409212335.QAA25549@rock>, Terry Allen writes:
>I've just been writing a piece in HTML and had trouble with
>anchors using Dan's 3 DTDs (or my 3in1.dtd derived from them).
>The content model for A assumes content
>and will not allow an omitted end tag (from html0.dtd).
>
><!ENTITY % A.content "(%heading|%block|%text)+">
><!ELEMENT A - - %A.content -(A)>
>
>However, the only way an A works properly as a target in Mosaic
>is if it is empty (has no end tag).

Not true. A works properly as long as there's something between
the A start tag and the A end tag. The idiom:

<A name="noContent"></A>

excercises what I'd like to call a bug in Mosaic.

> The example given in the doc
>(Elements/A.html) is correct in this respect:
>
><DT><CODE><A NAME="4MvVSWBSRpF84aK">href</CODE>

The above A element is not empty. The string "href" is included
in the content of that element. There's an implied </A> just
before </CODE>, if you will. (According to the current DTD, this
is just an error.)

The above markup is a result of the fact that in the source DTD
(NodeSet), link destinations are points, not spans. So it's more work
to write software which would have correctly inserted an A end tag.

<DT><CODE><A NAME="4MvVSWBSRpF84aK">href</A></CODE>

Our first inclination was to simply write:

<DT><CODE><A NAME="4MvVSWBSRpF84aK"></A>href</CODE>

but this excercises the aforementioned "bug" in Mosaic.

Perhaps we need a NOTE in the spec about this...

>(However, as NAME will eventually become an ID, the value of NAME
>given here, starting with a number, will become dysfunctional,
>because IDs must begin with a letter; how about knocking that 4 off
>the start of it and any others of the sort?)

I don't think NAME will ever become an ID attribute. It's just
not practical.

Perhaps we'll deploy ID attributes (and call them ID, not name).
I think the A tag is badly overloaded: it's the source of an anchor,
or the destination. It's used for footnotes, references within a
document, references across documents in the same "corpus," references
across corpuses, etc.

I'd prefer to replace A as the destination of a link by allowing any
number of elements to take an ID attribute (ala HTML+). I think it
would be useful to have some sort of link that uses ID/IDREF
attributes so that an SGML parser could be employed to check those
links. It might also be useful to indicate whether a link is to
something in the same "corpus" or to something in a vastly different
context, though it's not clear that we need special markup for
that. Perhaps that's the job of the author.

Anyway... none of this will happen in the near term...

>So the content model should be changed to:
>
><!ELEMENT A - O %A.content -(A)>

So you're advocating allowing folks to omit the </A> tag.
Murry, Eric Sink, and myself have all said "yuk," but nobody
has raised any technical objections.

Dan