W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2000

Re: HTML heading hierarchy for XHTML [RE-POST]

From: Jelks Cabaniss <jelks@jelks.nu>
Date: Fri, 24 Mar 2000 11:45:41 -0600
To: <html-tidy@w3c.org>
Message-ID: <OF6CB42E19.A8AA8D03-ON86256878.005A99C4@rfdinc.com>

Marc Rubin wrote:

> I'd like to preserve the implicit hierarchy of HTML headings when
> converting to XHTML. For example, I'd like to end up with this XHTML
> <h1>Heading 1 text
>         <h2>Heading 2 under heading 1</h2>>
> Would this translation be feasible as an option in Tidy?

Not unless Dave decides to let Tidy emit invalid [x]HTML.  If you look at
xHTML DTD[1], you will see that headings and paragraphs are defined as
block-level elements that can not contain other block-level elements, only
"text" and inline-level elements (like i, em, strong, etc.).

Also, if you think about it for a minute, you'll understand why.  Your
above shows a Heading-Level-2 *INSIDE* a Heading-Level-1.  Why would one
want a
heading inside another heading?  If you really do have some reason you want
do this, you'll have to invent your own document type, but it wouldn't be
we call XHTML or HTML.

[1] http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd

Received on Friday, 24 March 2000 13:14:30 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:47 UTC