W3C home > Mailing lists > Public > public-webapi@w3.org > January 2008

Re: [selectors-api] Best practice in HTML wellformed documents

From: Diego La Monica (IWA/HWG) <d.lamonica@webprofession.com>
Date: Wed, 2 Jan 2008 18:25:31 +0100
Message-ID: <e4cd4de70801020925n5d47b2a8na10bef3fbb951a3c@mail.gmail.com>
To: "Lachlan Hunt" <lachlan.hunt@lachy.id.au>
Cc: public-webapi@w3.org
On 02/01/2008, Lachlan Hunt <lachlan.hunt@lachy.id.au> wrote:
>
> Diego La Monica (IWA/HWG) wrote:
> >  in the section "1.1 Examples" the first example:
> >
> >> <table id="score">
> >>   <thead>
> >>     <tr>
> >>       <th>Test
> >>       <th>Result
> >>   <tfoot>
> >>     <tr>
> >>       <th>Average
> >>       <td>82%
> >>   <tbody>
> >>     <tr>
> >>       <td>A
> >>       <td>87%
> >>     <tr>
> >>       <td>B
> >>       <td>78%
> >>     <tr>
> >>       <td>C
> >>       <td>81%
> >> </table>
> >
> > does not produce errors in page interpretation by the browsers but it is
> not
> > correct in wellformed HTML table definition[1].
>
> While XHTML imposes the requirement to explicitly close all elements, it
> is not required in HTML.  In HTML, end tags for some elements, including
> those above, may be omitted.  This is a feature inherited from HTML's
> origin as an application of SGML.
>
> > Is it not better to define the correct markup (like above)?
> >
> > <table id="score">
> >   <thead>
> >     <tr>
> >       <th>Test</th>
> >       <th>Result</th>
> >     </tr>
> >   <thead>
> >   <tfoot>
> >     <tr>
> >       <th>Average</th>
> >       <td>82%</td>
> >     </tr>
> >   </tfoot>
> >   <tbody>
> >     <tr>
> >       <td>A</td>
> >       <td>87%</td>
> >     </tr>
> >     <tr>
> >       <td>B</td>
> >       <td>78%</td>
> >     <tr>
> >       <td>C</td>
> >       <td>81%</td>
> >     </tr>
> >   </tbody>
> > </table>
>
> (Note that your suggested replacement contains an error. You wrote
> <thead> instead of </thead>.)


Diego:
Sorry for the mistake... I loose a slash.

Lachlan Hunt:

> I decided to omit the end tags from the markup because they were
> unnecessary, it made the example markup smaller and, IMHO, clearer to
> read.  Therefore, since the current example actually is conforming, I
> have not changed it at this time.  Please let me know if you are not
> satisfied with this response.



Diego:
Not at all satisfied.

Proposal: Makes the example in the section 1.1 always valid and correct.
Solution: closing the unclosed tags.
Result: the document will be both HTML 4.01 valid and XHTML valid document.

--
Diego La Monica (IWA/HWG)
Received on Wednesday, 2 January 2008 17:25:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:19:00 GMT