Re: DW3 Code "Validation" Problem

by =?iso-8859-1?Q?St=E9phane?= Bergeron <stephberg(at)videotron.ca>

 Date:  Tue, 10 Oct 2000 22:49:12 -0400
 To:  hwg-techniques(at)hwg.org
 Cc:  "seaeagle(at)one.net.au" <seaeagle(at)one.net.au>
 In-Reply-To:  net
  todo: View Thread, Original
Hi Henry,

At 10:06 AM 11/10/00 +1000, you wrote:
>Hell again, all you wonderful wizards and weblock

>I've eyeballed the code and checked it with HomeSite 4.5's validator (aka
>TopStyle Lite).  Both of these say the code is correct.

Btw, TopStyle Lite is the style sheets editor that comes with HomeSite 4.5=
=20
and has nothing to do with its internal Validator... ;-)

As for the errors, read on...


>Can anyone tell me why Dreamweaver would insist that the following is
>"incorrect":
>
>      <.td align=3D"center">
><.p><.h1 align=3D"center"><.font color=3D"#0000ff">Sea Eagle
>Publications<./font><./h1><./p>
><.p><.h2 align=3D"center"><.font color=3D"#000080">Business Development
>Tools<./font><./h2><./p>
><.p><.h3 align=3D"center"><.font face=3D"arial, helvetica, sans-serif"
>color=3D"#800000">&quot;Creating Prosperity&quot;<./font><./h3><./p>
>     </td>
>
>while this is "correct":
>
>     <.td align=3D"center">
><.p><.h1 align=3D"center"><.font color=3D"#0000ff">Sea Eagle
>Publications<./font><./h1><.p><./p>
><.p><.h2 align=3D"center"><.font color=3D"#000080">Business Development
>Tools<./font><./h2><.p><./p>
><.p><.h3 align=3D"center"><.font face=3D"arial, helvetica, sans-serif"
>color=3D"#800000">&quot;Creating Prosperity&quot;<./font><./h3><.p><./p>
>     <./td>
>
>**** Note the additional <.p> at the end of each line.  DW3 has also added
>a <./font> before the <./td> on most pages.  I _know_ that's not valid
>HTML, regardless of specification!

The reason that the latter bit of code is flagged as valid and the former=20
one is flagged as invalid is that header tags cannot be nested within=20
paragraph tags.  More specifically, the error that was flagged here is that=
=20
the closing p tags after the closing header tags are considered orphaned=20
closing tags without opening tags by the validator because, since closing p=
=20
tags are optional,  as soon as the header tag is opened, the preceding p=20
tag is considered closed (even if it's "empty") and the closing p tag after=
=20
the closing header tag is seen as missing an opening tag by the validator=20
(that's because p and hx tags are both block level elements that cannot be=
=20
nested).  In this respect the W3C Validator's message was considerably more=
=20
helpful and should be considered the only 100% reliable validation=20
source.  I myself use CSE HTML Validator Pro 4.5 within HomeSite and it=20
didn't flag an error either which is disappointing.

Dreamweaver was perfectly right in flagging the former code bit as invalid=
=20
so there's no need to modify its validation setting (which I don't think is=
=20
possible anyway).  Out of curiosity, why would you want to insert header=20
tags within paragraph tags anyway?  If it's to create more space between=20
those elements, additional <br> tags would fit the bill nicely without=20
breaking the logical structure of the document.

In any case, I hope my explanation was clear!

St=E9phane Bergeron

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA