Peter Curran
<
pcurran@sympatico.ca> wrote:
Tidy
objects to a missing "li" tag. Of course, that is in the
generated code that Tidy cannot "see."
I
understand that Tidy cannot interpret the Javascript and verify
that
it generates the required "li" tag. However, the implication of
the
message is that only an "li" tag is permitted in this position
-
I
would think that a "script" tag should be valid, even if Tidy
cannot
interpret the results of executing the script.
...
My
question is, is a "script" tag really invalid here, or is Tidy
just
making the worst-case assumption, that the script may not
generate valid HTML code?
It's easy enough to find out. Just hop over to the
www.w3.org web site
and check the DTD. If we're talking about HTML 4 here, the rule
in the
DTD is quite simple and quite explicit:
<!ELEMENT UL - -
(LI)+
-- unordered list -->
This says, "A <UL> element may contain one or more
<LI> elements,
nothing else." Since this is an "element
content" model, white space
and comments are also allowed. But certainly no other elements
whatever
are allowed, and <SCRIPT> is no exception.