[whatwg] WA1 - The Section Header Problem

*Matthew Raymond* <mattraymond at earthlink.net>:
> 1) The <h#> elements should be depreciated.
> 2) The <h#> elements will have no SEMANTIC meaning when inside a  
> <section> header. Their presentation, however, will remain the same.
> 3) Within an <h> element, <h#> elements (...) will be ignored entirely.
> 4) The <h> element will be the only way to create a semantically valid  
> header for a section.
> 5) There should only be one <h> element for each section.
> 6) The only way to create semantically valid subsections within a  
> <section> element is to create child <section> elements (...)

My SGML-DTD (writing) skills are poor, but I wonder if this could be
achieved with something like

    <!ELEMENT section      O O (h, %flow;*)>
    <!ELEMENT h            O O (%heading; | %inline;*)>
    <!ELEMENT (%heading;)  - - (%inline;)*>

(See HTML4 DTD for entities, add 'section' to '%flow;' and remove
'%heading;' from it. The content models of 'section' and 'h' are probably
malformatted, but I hope you get the idea.)
This /should/---i.e. is intended to---magically start a new 'section'
before any 'h' and embed any 'h1'-'h6' in an 'h'. Still it allows the pure
XHTML2 style without numbered headings at all. Furthermore it makes the
inline content that appears immediately after "<section>" a heading, if no
explicit one is found---I don't know whether that's more good or more bad.

Note, however, that the CSS selectors "body>h", "body>h1" and "section>h1"
would never match with such markup. OTOH "section>h" will always be
successful in a valid document, except when there are no 'section', 'h'
and 'h#' element instances at all.

I remember ISO-HTML doing another but similar kind of DTD trickery to
enforce the correct order of heading levels, but I last read that spec
years ago.

JFTR: I'm undecided on the matter of heading markup.

PS: Sorry, Matthew, for the PM.

Received on Monday, 15 November 2004 22:50:48 UTC