W3C home > Mailing lists > Public > www-html@w3.org > August 2000

Re: XHTML Invalidity / WML2 / New XHTML 1.1 Attribute

From: Stephanos Piperoglou <stephanos@webreference.com>
Date: Tue, 15 Aug 2000 22:32:42 +0100 (BST)
To: Jan Roland Eriksson <jrexon@newsguy.com>
cc: www-html@w3.org
Message-ID: <Pine.LNX.4.21.0008152208420.7047-100000@highnoon.pipis.net>
On Tue, 15 Aug 2000, Jan Roland Eriksson wrote:

> >I.e.,in HTML4-compliant browsers, the CDO and CDC delimiters...
> Just to clarify. In SGML there are no 'delimiters' named CDO and
> CDC.  Those Acronyms where invented by CSS designers, to the best of
> my knowledge.

You can tell I've written a CSS parser, can't you? :-)

Interestingly enough:

	      White space is not permitted between the markup
	      declaration open delimiter("<!") and the comment open
	      delimiter ("--"), but is permitted between the comment
	      close delimiter ("--") and the markup declaration close
	      delimiter (">").

Is this the general SGML case or another HTML bug-avoidance feature? I
remember Netscape 1.1 having terrible trouble with comments. I recall
when Netscape 2.0 came out (or was it 3.0?) and the release notes
noted with glee how it now parsed HTML's "weird comment syntax" or
something to that effect. (I looked to find the specific release notes
but failed after a couple of attempts. What's interesting is that I
started by typing "http://home.mcom.com/" into my fresh Mozilla
build. I'm getting old.)

> Formally CDO and CDC does not exist in SGML but they have been
> defined by CSS designers to be char strings equal to what is used in
> SGML as the most compact form of an SGML declaration that only
> contains a comment.  For a specific purpose of course, workaround
> for some old browsers.

So, in conclusion, it *is* a hack :-)

In any case, I'd generally recommend people stick to the rules:

Open a comment with exactly "<!--"
Close a comment with exactly "-->"
If in a SCRIPT or STYLE element, put these on separate lines
If in a SCRIPT element, use "//-->"
Escape the string "--" anywhere inside a comment
Escape the string "/>" anywhere inside a SCRIPT or STYLE element

That should keep everyone out of trouble. The rest is just all of us
being pedantic :-)

Stephanos Piperoglou                              <stephanos@webreference.com>
Maintainer, HTML with Style                    <http://webreference.com/html/>
  Visit HTML with Style for online HTML and CSS tutorials with step-by-step
   procedures and practical examples to help you author Web pages that are
 full-featured, standards-compliant and backwards-compatible, tools to make a
 Web author's life easier, software reviews, opinions, industry news and more
Received on Tuesday, 15 August 2000 15:32:18 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 30 April 2020 16:20:40 UTC