By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,487 Members | 1,090 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,487 IT Pros & Developers. It's quick & easy.

W3C Validator and empty body element

P: n/a
Hello.

Running the following document through the W3C's validator, returns the
error: "end tag for "body" which is not finished."

<!-- Start of sample document -->
<?xml version="1.0" encoding="iso-8859-1"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-BR">
<head>
<title>Foo</title>
</head>
<body>
</body>
</html>
<!-- End of sample document -->

However, the specification document has the /minimal content model/ for
the body element as "(Heading | Block | List)*". Does it not mean that
the body element *is* allowed to be empty? Where does the problem lie:
in my understanding, in the validator or in the specification?

[1]
http://www.w3.org/TR/xhtml-modulariz...tructuremodule

Thank you,

--
Ney André de Mello Zunino
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Ney André de Mello Zunino <zu****@inf.ufsc.br> wrote:
Running the following document through the W3C's validator, returns
the error: "end tag for "body" which is not finished."
It seems that you have encountered a silent (well, almost silent) change
in XHTML 1.1 as compared with XHTML 1.0 Strict - a change not listed in
the section of changes, admittedly labelled informative but presented in
a manner that suggests exhaustiveness:
http://www.w3.org/TR/xhtml11/changes.html#a_changes

XHTML 1.1 does not allow a body element with no content, while all
previous versions of HTML allow it. This is of rather little practical
value of course, both because documents with empty body are rather
uninteresting and because XHTML 1.1 is an exercise in futility.
However, the specification document has the /minimal content model/
for the body element as "(Heading | Block | List)*". - - http://www.w3.org/TR/xhtml-modulariz...es.html#s_stru
cturemodule
This is an error in the specification. The prose differs from the formal
syntax, which is apparently to be taken as more authoritative, and which
is naturally all that a validator sees:

<!ENTITY % body.content
"( %Block.mix; )+"
<http://www.w3.org/TR/xhtml-modulariz...ule_defs.html#
a_module_Structure>

The "+" sign, as opposite to "*", in the DTD indicates that there must be
at least one occurrence of %Block.mix. So naturally the prose description
should have (Heading | Block | List)+ as the minimal content model.

Actually that wouldn't be quite accurate. For example, an XHTML 1.1
document with <body><ins></ins></body> is valid. The definition of
%Block.mix is

<!ENTITY % Block.mix
"%Heading.class;
| %List.class;
| %Block.class;
%Misc.class;"
<!ENTITY % Misc.class
"%Edit.class;
%Script.class;
%Misc.extra;"


(XHTML 1.1 syntax is inconvenient to read due to the modularization
approach, but the above should suffice to indicate that the prose really
simplifies things.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #2

P: n/a
Ney André de Mello Zunino wrote:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-BR">


I don't know if this is your problem, but your original post had double
close-quotes after the xmlns URI.

--
Mark.
Jul 20 '05 #3

P: n/a
Mark Tranchant wrote:
Ney André de Mello Zunino wrote:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-BR">


I don't know if this is your problem, but your original post had double
close-quotes after the xmlns URI.


I went back to the original post but could not see the extra double
quote there. Anyway, I double-checked the actual test file and it does
not have it. But thanks for the observation. Actually, I am curious now,
because I also seem to have noticed that extra double quote right after
having posted the message. It is not there anymore.

Thank you also, Jukka, for your insights.

--
Ney André de Mello Zunino
Jul 20 '05 #4

P: n/a
Ney André de Mello Zunino wrote:
[...] Actually, I am curious now,
because I also seem to have noticed that extra double quote right after
having posted the message. It is not there anymore.


Guess what? I have just looked at the original post again, this time
from my home computer. The extra double quote is there! Weird stuff. I
use Thunderbird 0.7.2 both here and at work, only here it is the Windows
version and there, the Linux one. Go figure.

Cheers,

--
Ney André de Mello Zunino
Jul 20 '05 #5

P: n/a
Ney André de Mello Zunino wrote:
Ney André de Mello Zunino wrote:
[...] Actually, I am curious now, because I also seem to have noticed
that extra double quote right after having posted the message. It is
not there anymore.



Guess what? I have just looked at the original post again, this time
from my home computer. The extra double quote is there! Weird stuff. I
use Thunderbird 0.7.2 both here and at work, only here it is the Windows
version and there, the Linux one. Go figure.


Yeah, really weird. I'm also using TB-0.7.2/Win and I see it in the
original post. When I hit Reply, it disappeared from the "reply-to"
text. The Message Source of the original message also doesn't show it.

--
Mark.
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.