[thelist] Validation Problems

shawn allen shawn at alterior.net
Wed Oct 23 13:30:01 CDT 2002

quoth Nickolay Kolev:
> I am having trouble validating my blog page as XHTML Strict... It does
> validate as transitional, but there are four form related errors as
> strict. I cannot however imagine how to "repair" them...

Try reading into the errors a bit further... Better yet, take a look at
the associated DTD, and you'll see why, for instance, an anchor isn't
allowed directly in body. In XHTML Strict
<http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>, you have:

<!ELEMENT body %Block;>

Which means that the body element can only contain block-level elements
(search for "<!ENTITY % Block" if you need to know what elements
constitute as block-level). Try enclosing your anchor in a paragraph.

Most of your form-related errors are the same issue. The relevant parts
of the DTD are:

<!ELEMENT form %form.content;> <!-- forms shouldn't be nested -->

<!ENTITY % form.content "(%block; | %misc;)*">

<!ENTITY % misc.inline "ins | del | script">

<!-- these can only occur at block level -->
<!ENTITY % misc "noscript | %misc.inline;">

Which together translate to: "form may only contain block-level
elements, ins, del, script, and noscript". Again, wrap your form
elements in paragraphs and you should be good to go. As for the name
attribute, check out <http://www.w3.org/TR/xhtml1/#C_8> for more info.
Conforming to XHTML Strict may render your forms inaccessible by older
UA's that depend on the name attribute, so if that's an issue you may
want to consider sticking with the Transitional DTD.

shawn allen
  e: shawn at alterior.net
  p: 415 577 3961
  im: shawnpallen

More information about the thelist mailing list