W3C home > Mailing lists > Public > public-html@w3.org > January 2011

Re: rationale for inclusion of hgroup in html5?

From: Jirka Kosek <jirka@kosek.cz>
Date: Mon, 24 Jan 2011 11:58:32 +0100
Message-ID: <4D3D5B58.9020709@kosek.cz>
To: Steve Faulkner <faulkner.steve@gmail.com>
CC: Anne van Kesteren <annevk@opera.com>, HTML WG <public-html@w3.org>
Steve Faulkner wrote:

> I understand that having a subheading/subtitle is quite common, What i am
> seeking is detailed reasoning on why hgroup was chosen as the method to
> represent the semantics of subheadings. Even some data on the use of hgroup
> like container elements around heading/subheadings would be useful, for
> example the example you cite:
> 
> <h1><a id="title" name="title">Extensible Markup Language (XML) 1.0 (Fifth
> Edition)</a></h1>
> <h2><a id="w3c-doctype" name="w3c-doctype">W3C Recommendation 26 November
> 2008</a></h2>
> 
> uses a <div class="head"> to go around the headings and other content, not a
> div acting as a container for the heading/subheading.

DocBook has title/subtitle for ages. If you have DocBook content like:

<section>
  <title>Foo</title>
  <subtitle>Bar</subtitle>
  ...content of section...
</section>

it is usually transformed to HTML as:

<div class="section">
  <div class="titlepage">
    <h2 class="title">Foo</h2>
    <h3 class="subtitle">Bar</h3>
  </div>
  ... content of section ...
</div>

But note that <div class="titlepage"> is there for completely different
reasons that <hgroup> -- it wraps all metadata about section of content
-- there could be author, publication date, abstract, ... -- and you
might want to apply different styling for this content. So it is more
closer to HTML5's <header> element.

If the only purpose of <hgroup> is to eliminate some elements from
outline, then I think that much more better and flexible solution is to
explicitly mark subtitles as such when this can't be inferred from
structure, e.g.

<h2>Title</h2>
<h3 role="subtitle">Subtitle</h3> <!-- Explicit removal from outline -->

vs.

<section>
  <h2>Title</h2>
  <h3>Subtitle</h3>              <!-- Implicit removal from outline -->
  ...
</section>

vs.

<section>
  <h2>Title</h2>
  <section>
    <h3>Title of nested section</h3>
    ...
  </section>
  ...
</section>

				Jirka


-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------


Received on Monday, 24 January 2011 10:59:11 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:22 UTC