This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22372 - validator claims 'document type does not allow element "UL" here', but I think HTML 4.01 Transitional does; or else HTML 4.01 Specification is unclear
Summary: validator claims 'document type does not allow element "UL" here', but I thin...
Status: NEW
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: 1.3
Hardware: PC Linux
: P2 minor
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL: http://www.plam.cantech.bg
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-15 04:43 UTC by J. Randall Owens
Modified: 2015-02-16 00:38 UTC (History)
1 user (show)

See Also:


Attachments

Description J. Randall Owens 2013-06-15 04:43:20 UTC
Test case: http://validator.w3.org/check?uri=http%3A%2F%2Fhtdr.e-junkie.com%2Fadmin%2Ffieldset_test.php&charset=%28detect+automatically%29&doctype=Inline&ss=1&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices
If Bugzilla has a problem with the URL more than a line long, shortened:
http://tinyurl.com/lekusql
http://preview.tinyurl.com/lekusql if you're paranoid


This is the pretty bare-bones test case here. A fieldset within a form, and an unordered list within the fieldset. The Validator tells me 'document type does not allow element "UL" here'. If I enable a legend element in it (currently commented out) before the UL, it validates. But in the HTML 4.01 Transitional (which that page is) DTD:

<!--
  #PCDATA is to solve the mixed content problem,
  per specification only whitespace is allowed there!
 -->
<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
<!ATTLIST FIELDSET
  %attrs;                              -- %coreattrs, %i18n, %events --
  >

<!ELEMENT LEGEND - - (%inline;)*       -- fieldset legend -->

<!ATTLIST LEGEND
  %attrs;                              -- %coreattrs, %i18n, %events --
  accesskey   %Character;    #IMPLIED  -- accessibility key character --
  >

I've forgotten a thing or two about reading DTDs; is the LEGEND there supposed to be mandatory? If not, then it would seem to be a Validator bug.

If it is mandatory, there are at least two other things that would need fixing. The Nu Validator does validate this page:
http://validator.w3.org/nu/?showsource=yes&doc=http%3A%2F%2Fhtdr.e-junkie.com%2Fadmin%2Fsimple_test_html.php

(perhaps a difference between DTD & Schema?)
and, the HTML 4.01 Specification, http://www.w3.org/TR/html4/interact/forms.html#h-17.10 , says nothing about requiring a LEGEND in each FIELDSET (aside from quoting the DTD as above), and furthermore says, "[t]he LEGEND element allows authors to assign a caption to a FIELDSET," where "allows" seems to imply that it isn't mandatory.
Comment 1 J. Randall Owens 2013-06-15 04:56:39 UTC
I forgot to mention the other possibility I was considering, that I'm not understanding %flow; in the DTD correctly. It looks as though %flow; can be either %block; or %inline;, and %block; can be %list; among others, and %list; can be either UL or OL, of course. But like I said, I've forgotten plenty about reading DTDs.