HTML5: DTD module for body

Here’s my first draft for the body of an HTML5 document. It needs some explanations:

  1. The new article element is still missing in my draft.
  2. I like the new section element to give a HTML page a strict structure, like in a book. I don’t like the idea of implicit sections, which emerge from h*-elements. Therefore the content model allows headings only within sections (“explicit sections”). (Cite from the current spec: “Authors are also encouraged to explicitly wrap sections in elements of sectioning content, instead of relying on the implicit sections generated by having multiple headings in one element of sectioning content.“)
  3. I think the new elements header, aside, footer are motivated from blog sites. (BTW It’s a shame that a header (footer) has not necessarily to be placed at the top (bottom) of the page, that aside doesn’t place it’s content in a sidebar. That’s not easy to explain.)
  4. I expect people still want to be able to write HTML pages without any structure.

Because of (2), (3) and (4) I designed a content model for body which reflects the three scenarios: A sequence of block elements, a blog page and a structured document. I dropped the heading h3 – h6, because the meaning of a heading is derived from it’s “section” ancestors. Only h1 is used within a section. I kept the name “h1″ (not “heading”), don’t want to introduce new elements. h2 is available only in hgroup; together with h1 it forms something like a “title and subtitle”.

Here’s the DTD module:

<!-- ========= body ========= -->
<!--
 A body is

 1. a sequence of block elements ("no structure" = "legacy html - headings")
 or
 2. a header, a sequence of sections and a footer ("common web page layout")
 with optional aside element ("blog layout")
 or
 3. sections with exactly one heading and subsections ("book-like structure")
-->
<!ELEMENT body         ( (%block;)
                         | (header, aside?, section+, footer)
                         | (%H5SectioningContent;)) >

<!-- ========= structure elements ========= -->

<!ELEMENT section      (%H5SectioningContent;) >
<!ATTLIST section
 %commonAttrs;
>

<!ELEMENT header       ( (h1 | hgroup), (%block;)+ )>
<!ATTLIST header
 %commonAttrs;
>

<!ELEMENT footer       (%block;)+>
<!ATTLIST footer
 %commonAttrs;
>

<!ELEMENT aside        (%H5SectioningContent;) >
<!ATTLIST aside
 %commonAttrs;
>

<!-- ========= headings ========= -->

<!ELEMENT hgroup       ( h1, h2 ) >
<!ATTLIST hgroup
 %commonAttrs;
>

<!ELEMENT h1           (#PCDATA)>
<!ATTLIST h1
 %commonAttrs;
>

<!ELEMENT h2           (#PCDATA)>
<!ATTLIST h2
 %commonAttrs;
>
<!-- $Id: html5-body-structure.mod 8269 2011-06-01 13:07:55Z sm $ -->

Currently the parameter entity H5SectioningContent is defined as:

<!ENTITY % H5SectioningContent "(h1 | hgroup),
                                (
                                 ((%block;)+, (section)*)
                                 |
                                 (section)+
                                )">

The definition of block is yet to come. It will contain what you expect, p, lists, div, table … Maybe the name of the entity will change…

 

This entry was posted on 01/06/2011 in DTD, proposal and tagged , , , . Bookmark the permalink. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.

 
Creative Commons License
HTML5 DTD by Stefan Mintert/Linkwerk GmbH is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.