Re: FIELDSET, LEGEND, HTML, & XHTML (Might be a bug in XHTML or HTML)

Hash: SHA1

Hello Joe,

Am Freitag, 8. Februar 2002 18:36 schrieb Joe Kaczmarek:
> First the question:
> Why does HTML validation require a LEGEND for FIELDSET, while XHTML
> validation does not?
The definition of fieldset is indeed quite relaxed in XHTML 1.0 Strict:
<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
The same applies to XHTML 1.0 Transitional:
<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>

While this is the definition of fieldset in HTML 4.01 Strict:
<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
And this is the definition of fieldset in HTML 4.01 Transitional, again the 
<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->

The definition in Modularization of XHTML is:
<!ENTITY % fieldset.element  "INCLUDE" >
<!ENTITY % fieldset.content
     "( #PCDATA | %legend.qname; | %Flow.mix; )*"
<!ELEMENT %fieldset.qname;  %fieldset.content; >
<!-- end of fieldset.element -->]]>
Which is translated into
<!ELEMENT fieldset (#PCDATA | legend | %Flow.mix;)*>
and looks like a mixture of the HTML 4.01 and XHTML 1.0 definition.

This is obviously either an undocumented change in the semantics and 
behaviour of fieldset or just a bug (typo: | instead of ,).

I suggest you report this as a bug, because it is either a bug in the dtd 
(the dtd is wrong and should be different) or it is a bug in the 
documentation of XHTML because this change has not been documented.

> Now some background:
> While checking my site at Bobby ( it
> recommended using FIELDSET within FORMs. Now, maybe since I only have
The validator sometimes only can guess what might have to be done to get the 
file valid if it is invalid. The recommendation of the validator is not 
neccessarily the best solution, it's just one that works.

Usually problems with forms in XHTML are that newer versions require form to 
contain block, not flow. So a nested <div/> or <p/> containing the form 
elements usually helps.

> one field within my FORM this isn't needed, but when I included
> FIELDSET, I could no longer validate as HTML 4.01 Transitional without
> also including LEGEND.
> But, another site I checked for reference
> ( is written in XHTML 1.0 Strict,
> includes FIELDSET, does not have a LEGEND, and yet it validates.
> Is there a discrepency that XHTML does not require LEGEND with FIELDSET
> but HTML does?
Yes, as described above, there obviously is.

- -- 
Christian Wolfgang Hujer
Geschäftsführender Gesellschafter
Telefon: +49 (089) 27 37 04 37
Telefax: +49 (089) 27 37 04 39
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see


Received on Sunday, 10 February 2002 05:57:06 UTC