Re: ISO HTML and headings

Tim Bagot <tsb-w3-html-0001@earth.li> wrote:

> Last night I noticed something rather strange in ISO HTML: its DTD seems
> to permit the heading elements, H1-H6, only as direct children of BODY. In
> particular, they are not allowed as children of DIV elements.

Well, I think I asked editors of ISO-HTML about this at the Future of
HTML workshop two years ago ...

> Can this
> really be intended?

Probably to impose the proper nesting of sections while being a complete
subset of HTML 4 Strict.  ISO-HTML normatively requires the proper
nesting of sections [1], e.g. the H1 element shall not be followed by
an H3, H4, H5 or H6 element without an intervening H2 element.  

To impose this constraints, earlier draft of ISO-HTML had B1 through
B6 elements, which correspond to H1 through H6, defined like this:

  <!ELEMENT BODY         - -  (%section.content;, (H1,B1)*) >
  <!ELEMENT H1           - -  (%text;)* >
  <!ELEMENT B1           O O  (%section.content;, (H2,B2)*) >
			(snip)

But later they decided to make ISO-HTML a complete subset of HTML 4
Strict, thus B1 through B6 cannot be used.  So they included 
informative marked section in the DTD to make it possible for
an SGML parser to validate the correct nesting of sections [2],
so-called "Pre-HTML" (a.k.a. "almost ISO-HTML"), defined like this:

  <!-- The following marked section is informative only -->
  <![ %Preparation; [
  <!ELEMENT Pre-HTML    - -  (HEAD, BODY) >
  <!ELEMENT BODY        - O  ((%block;)*,(H1,DIV1)* ) +(DEL|INS) >
  <!ELEMENT H1          - -  (%text;)+ >
  <!ELEMENT DIV1        O O  ((%block;)*, (H2,DIV2)* ) >
			(snip)
                   ]]>

This is for document preparation only (DIV1 through DIV6 elements are
for internal use only and shall not appear in document instances), and
the normative definition of the BODY content is as follows:

  <!ELEMENT BODY        - O  (%block;|H1|H2|H3|H4|H5|H6)+ +(DEL|INS) >

Any ISO-HTML document shall conform to the latter normative definition,
but while the former definition itself is informative only, proper
nesting of sections is still the normative requirement of ISO-HTML, so
conforming ISO-HTML documents should also conform to the constraints
of the former.

Due to this constraints, other block-level elements cannot be used
as parents of H1 through H6.

As you may guess, this constraints have "side effect", e.g. you
cannot use DIV to apply styles that cover a heading and its following
section ... you may find another "side effect" in forms.

[1] http://purl.org/NET/ISO+IEC.15445/Users-Guide.html#h1
[2] http://purl.org/NET/ISO+IEC.15445/Users-Guide.html#PRE-H1

Regards,
-- 
Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium

Received on Monday, 25 September 2000 05:32:19 UTC