Re: HTML-WG Discussions

Joe English (joe@trystero.art.com)
Sat, 12 Nov 94 17:52:05 EST

weibel@oclc.org wrote:
> HTML-WG is specifically *not* a forum for questions and answers concerning
> the workings of HTML. The list *has* been quiet the past few days, largely
> because of preparation of the standard for formal submission. It will
> undoubtably not stay quiet long ;-).
>
> Having said all that, does David Paul's question
> [ on attribute values ] suggest an opportunity
> for clarifying the standard?

Yes, definitely. This and similar questions have been
coming up very frequently on www-talk and c.i.www.*
recently.

Some items that should be clarified:

* Are quotes always allowed around attribute values?
[ Yes. ]

* Are quotes ever *necessary* around attribute values?
[ Only if the specified value is not a name token.
E.g., <A HREF=next-page> is OK, but <A HREF=http://...>
is not.

The attribute's declared value (NAME, ID, CDATA, etc.)
in the DTD doesn't matter in this context. ]

* Can attribute value literals contain entity references?
(<IMG ALT="A &lt; B">)
[ Yes, and they should be expanded. ]

* But the XXX attribute is declared as CDATA in
the DTD. Doesn't that mean that entities aren't allowed?
[ No. CDATA in this context just says that the *value*
may be any character data (as opposed to name tokens
or IDs). Attribute value literals are always *parsed*
as replaceable character data. ]

* Can attribute values contain other HTML elements?
(<IMG ALT="<HR>")
[ No. Well, <IMG ALT="<HR>"> is legal, but the alternate
text will be the literal text <HR>, not a horizontal
rule. ]

* What's the difference between <A HREF='...'> and
<A HREF="...">?
[ None, except that " can appear in the value if you use '...'
but not if you use "...", and conversely.
If you need both ' and ", you can use character
references "Single: &#39;, double: &#34;" ]

--Joe English

joe@trystero.art.com