|
Posted by Ney André de Mello Zunino on August 1, 2004, 2:37 am
Please log in for more thread options
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-modularization/abstract_modules.html#s_structuremodule
Thank you,
--
Ney André de Mello Zunino
|
|
Posted by Jukka K. Korpela on August 1, 2004, 8:00 am
Please log in for more thread options
> 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-modularization/abstract_modules.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-modularization/dtd_module_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
|
|
Posted by Mark Tranchant on August 2, 2004, 8:42 am
Please log in for more thread options 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.
|
|
Posted by Ney André de Mello Zunino on August 2, 2004, 5:47 pm
Please log in for more thread options 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
|
|
Posted by Ney André de Mello Zunino on August 2, 2004, 7:38 pm
Please log in for more thread options 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
|
| Similar Threads | Posted | | Good practice ? Empty content in element | August 10, 2005, 3:58 am |
| Empty SGML parser results in w3 validator | November 20, 2004, 1:42 am |
| Element "x" undefined when using validator | February 10, 2006, 2:16 pm |
| Re: is invalid html 4 strict? | June 21, 2008, 1:43 pm |
| Re: is invalid html 4 strict? | June 21, 2008, 6:15 pm |
| Can TR element be direct child node of TABLE element? | February 13, 2005, 12:17 pm |
| Problem with xhtml Validator at http://validator.w3.org/ | July 27, 2005, 5:06 am |
| BODY DIR=LTR | March 7, 2006, 9:01 am |
| mailto: and URL in body | April 21, 2005, 11:30 am |
| question about the BODY tag in the HTML DTD | April 8, 2008, 3:36 pm |
|