Re: HTML comments in <title> elements - valid or not?

Arjun Ray wrote:
> On Tue, 2 Nov 1999, Sean Richardson wrote:
>
> > According to <URL:http://www.w3.org/TR/REC-html40/struct/global.html#h-7.4.2>
> > "Titles may contain character entities (for accented characters, special 
> > characters, etc.), but may not contain other markup."
> 
> Yet another place where the 4.0 spec's "friendly prose" fails to state the
> exact requirements.

What's not exact about it? Comments are markup[1]. The spec says don't
put
any markup except character entities. So the example given:

	<TITLE><!--This title has a comment in it.-->This is the title</TITLE>

doesn't conform to the HTML 4.0 spec.

Perhaps we should have added a NOTE about why this restriction is there:
it's there because older HTML implementations treated <!--...---> as
character data, and I think some versions of the HTML spec declared
the TITLE element as CDATA. So there are known interoperability
problems,
so authors are prohibited from going there.

Let's see if I can find the original IETF html-wg discussion of CDATA
vs. PCDATA for TITLE... nope; but reviewing the changes to of
html.dtd[2],
I see that TITLE was RCDATA for a while, then changed to %title-content
which could be either CDATA or PCDATA in v1.8, 
date: 1994/04/09 01:02:10. So if you can find html-wg archives from
around there (we have them somewhere at W3C, I think) you'll probably
find it discussed.



[1] http://www.w3.org/MarkUp/SGML/productions.html#prod91

[2] http://www.w3.org/MarkUp/html-spec/html.dtd
(hm... the ,v file isn't available via HTTP. bummer. see:
http://www.w3.org/MarkUp/html-spec/ChangeLog )

p.s. I composed this reply by hand from the archive, so it won't
have the right References: or In-Reply-To: headers. :-{

-- 
Dan Connolly, W3C
http://www.w3.org/People/Connolly/

Received on Monday, 8 November 1999 11:35:52 UTC