Re: xhtml 2.0 working draft feedback

webhooligan wrote on Wednesday, May 21, 2003 at 12:44:26 PM:

> While I do like the idea of removing the numbered heading elements
> from the specification, the <section> element seems redundant to the
> <div> element.

The div element, like the span element, has no real semantic purpose.
The div element is often used to denote logical sections in documents,
but it was never intended for that purpose in particular. The div
element is supposed to be a generic element for use where no other
element would be appropriate. Thus, using div elements for paragraphs
isn't okay, but using them to represent sections of documents was
actually encouraged. In my experience, that's mostly what the div
element is used for.

The widespread demand for a section element is what warranted its
creation. The majority of div elements out there are pseudo section
elements, which makes including a section element an easy decision,
but also has the unfortunate effect of exposing the widespread
confusion of the div element's purpose. Those with knowledge
overwhelmingly said "use divs to mark up sections"; very few explained
why.

A close examination of the div and section elements makes their
differences clear. The div element:

    The div element, in conjunction with the id and class attributes,
    offers a generic mechanism for adding extra structure to
    documents. This element defines no presentational idioms on the
    content. Thus, authors may use this element in conjunction with
    style sheets, the xml:lang attribute, etc., to tailor XHTML to
    their own needs and tastes.

The section element:

    The section element, in conjunction with the h element, offers a
    mechanism for structuring documents into sections. This element
    defines content to be block-level but imposes no other
    presentational idioms on the content, which may otherwise be
    controlled from a style sheet.

As XHTML 2 says, the div element is for "generic", "extra" structure,
whereas the section element specifically contains sections. Now
there's a proper section element, which means using the div element to
mark up sections will no longer be appropriate. Ideally, the div and
span elements would have a relatively low usage. They shouldn't become
so prevalent with a particular meaning that people begin to think the
element has that meaning. At that point, it's good to consider
creating a new element, specifically suited to fill the deficiency.
The nl element is another example of this sort of element creation,
albeit less pervasive. In that case, the unordered or ordered list
elements, and sometimes the div element, were being used, often with
an id of "nav" or "navigation", because no more appropriate element
existed. The nl element is meant soley for navigation lists, enabling
among other things a richer default presentation.

> Also, I'm not yet convinced as to the effectiveness of the <l>
> element over the <br /> element. I understand that the <l> element
> has greater potential for styling, and I do believe I would use it
> under certain circumstances, however I do not think it warrents
> deprecating the <br /> element.

The l element has the important distinction of having some meaning,
whereas the br element is mostly a presentational element. For those
cases where the br element's use was warranted, the l element can
replace it. Where the use was strictly presentational, in XHTML 2 you
can continue using the br element (for now), but you're advised to
consider using style sheets instead. Verse and code are the primary
examples of correct usage. The br element has been deprecated instead
of removed precisely because the l element will take some getting used
to. It's a way to start getting rid of the br element without actually
getting rid of it.

This one is still up in the air, by the way. If you want to make an
argument for keeping the br element without deprecation, please do so!

-- 
John Lewis

Received on Thursday, 22 May 2003 03:02:47 UTC