473,320 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

W3C Validator and empty body element

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
5 2741
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Mikko Ohtamaa | last post by:
From XML specification: The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. (This means that <foo></foo> is equal to...
17
by: Colin Cogle | last post by:
------- Line 47, column 8: there is no attribute "id" <DIV id="LeftNavigation" style="position:absolute; left:8px; top:6px; width:200p ------- Line 47, column 31: there is no attribute "style"...
12
by: thomas_jedenfelt_1 | last post by:
Hi everyone, Is the W3C HTML Validator in error when it returns <br /> as valid for HTML 4.01 Strict doctype? In March 2004 , the Validator returned <br />, <hr /> and <img /> as invalid for...
3
by: Support | last post by:
Hello: I used the code in the first example from: http://support.microsoft.com/default.aspx?scid=kb;en-us;316712 I get an "error on the page" line 4 char 1 syntax error Code:0 test.aspx The...
0
by: jennifer.perkins | last post by:
I've seen a couple posts by people having similar problems, but the suggested solutions I've tried so far haven't worked. I'm using a SOAP client in VB.Net (constructed by wsdl.exe) and the...
40
by: VK | last post by:
Hi, After the response on my request from W3C I'm still unclear about Tidy vs. Validator discrepansies. That started with <IFRAME> issue, but there is more as I know. Anyway, this very basic...
9
by: Joshua Franco | last post by:
I am having trouble with the W3C html validator. The page: http://www.acmlm.org/beta/ is listed by the validator as not valid html 4.01 strict. I belive this page to be correct though. The...
0
by: Fred | last post by:
I am trying to build a consumer to a webservice which use soapheader. I am using Visual Studio 2003. Please see the wsdl-file below. Why is it that the SOAPHEADER is empty when I use it int the...
37
by: Prisoner at War | last post by:
Actually, it doesn't have to be a blockquote...but I'm at my wits' end: I want to make bold several lines of text which have a pair of <br /tags between them...seems like the <b></bdo not "carry...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.