Re: assorted HTML and SGML questions

> From: jbw@cs.bu.edu (Joe Wells)
> >>>>> "lee" == <lee@sq.com>
> >>>>> "Dan" == Daniel W Connolly <connolly@beach.w3.org>

Joe> Q: (("text/html" Internet Media Type)) Does text/html forbid
Joe> including the SGML declaration (<!SGML ...>)?  I know it forbids
Joe> including a document type declaration subset, but the standard is
Joe> unclear on whether the SGML declaration is allowed.

Dan> (confused) No. In fact, it requires it...
Dan> 	<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

As Dan has pointed out, the DOCTYPE line is, strictly speaking, required.
Probably it should have the RFC number in it, but of course, we didn't
have an RFC number when the RFC was being written...  The version is
sufficient, though.

> Does that mean that the following is
> illegal because the first thing is not a document type declaration?
>   <!-- document type declaration on next line -- >
>   <!doctype html public "-//IETF//DTD HTML 2.0//EN">

Yes.  ALso, including an SGML declaration would be illegal for the same
reason.  Luckily, you don't need your own SGML declaration for HTML, and if
you did try and use one, you'd break most existing browsers and editors in
interesting but unhelpful ways.

Joe> Q: ((HTML and Empty P Elements)) What are the semantics of an
Joe> empty P element in HTML?  The standard doesn't really seem to
Joe> deal with this.

lee> If by an empty P you mean <P></P> then what do you want the RFC to
lee> say?

> This is what I mean, except that it more commonly takes one of these
> forms:
>   <p><p><p><p>
>   <p><hr>
>   <p><ul><li>text text<p><li>more text</ul>

In each of these cases, a conforming browser is inserting </P> (at least
conceptually) in the right places:
>   <p></p><p></p><p></p><p></p>
>   <p></p><hr>
>   <p></p><ul><li>text text<p></p><li>more text</ul>

These are all paragraphs which contain no text (as Terry pointed out).
A browser can do what it likes with them -- for example, starting a new line
and putting a paragraph sign and a paragraph number in the margin.

Most just start a new line.
Some browsers give you multiple blank lines with <P></P><P></P> and some don't.

Lee

-- 
Liam Quin, SoftQuad Inc +1 416 239 4801 lee@sq.com   <URL:http://www.sq.com/>

Received on Sunday, 19 November 1995 18:01:33 UTC