Try it. It just doesn't work that way. An SGML parser can only infer
required start tags.
[This should be in a SGML FAQ or some such...]
connolly@ulua {** NONE **}../html-test[4416] cat test.sgml
<!DOCTYPE TEST [
<!ELEMENT TEST O O (HEAD, BODY)>
<!ELEMENT HEAD O O (TITLE)>
<!ELEMENT TITLE - - (#PCDATA)>
<!ELEMENT BODY O O (P | H1)*>
<!ELEMENT H1 - - (#PCDATA)>
<!ELEMENT P O O (#PCDATA)>
]>
<TITLE>testing</TITLE>
<H1>Here we go...</H1>
This causes problems.
<p>This would be fine
<p>And so would this.
connolly@ulua {** NONE **}../html-test[4417] sgmls -s test.sgml
sgmls: SGML error at test.sgml, line 11 at ".":
Out-of-context data ended TEST document element (and parse)
Take out the "problems" line, and it's fine:
connolly@ulua {** NONE **}../html-test[4420] cat test.sgml
<!DOCTYPE TEST [
<!ELEMENT TEST O O (HEAD, BODY)>
<!ELEMENT HEAD O O (TITLE)>
<!ELEMENT TITLE - - (#PCDATA)>
<!ELEMENT BODY O O (P | H1)*>
<!ELEMENT H1 - - (#PCDATA)>
<!ELEMENT P O O (#PCDATA)>
]>
<TITLE>testing</TITLE>
<H1>Here we go...</H1>
<p>This would be fine
<p>And so would this.
connolly@ulua {** NONE **}../html-test[4421] sgmls -s test.sgml
connolly@ulua {** NONE **}../html-test[4422]
Dan