Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Validator Problem

0 views
Skip to first unread message

Joshua Franco

unread,
May 9, 2006, 11:17:07 PM5/9/06
to
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 validator's
indication of "Line 112, column 3: end tag for element "P" which is not open
." appears to be in error. The tag IS open at that point. That line closes
it.

Please advise as to why the validator would behave incorrectly like this.


Benjamin Niemann

unread,
May 10, 2006, 7:08:12 AM5/10/06
to
Joshua Franco wrote:

> 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
> validator's indication of "Line 112, column 3: end tag for element "P"
> which is not open ." appears to be in error. The tag IS open at that
> point.

No it is not. You are trying to put a TABLE in a P element, which is not
allowed (P may only contain inline elements, TABLE is a block element).
Because the end tag for P is optional, it is implicitly inserted right
before the start tag of TABLE. This is intended behaviour, so there is
nothing invalid at that point (but it would still be nice, if the validator
would mention it, because it often confuses people, as you just
demonstrate...).

> That line closes it.

P was implicitly closed, so here's an end tag without matching start tag.


--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/

Chris Morris

unread,
May 10, 2006, 7:08:31 AM5/10/06
to

The validator (as usual) is perfectly correct.
You have
<p><table>...</table></p>
In HTML 4, paragraphs have optional end tags and are implicitly closed
by the start of any other block-level element (such as tables) so
that code actually should be read as:
<p></p><table>...</table></p>
at which point the spare end tag should be obvious.

The easiest solution is probably to remove the paragraph, since it's
not doing anything useful in this situation.

--
Chris

Michael Fesser

unread,
May 10, 2006, 7:12:03 AM5/10/06
to
.oO(Joshua Franco)

>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 validator's
>indication of "Line 112, column 3: end tag for element "P" which is not open
>." appears to be in error.

The validator is correct.

>The tag IS open at that point.

Nope. The problem are these lines:

94: <p class='center'>
95: <table class='table' cellspacing="0">

You can't put block-level content in a paragraph. The paragraph will be
closed implicitly before the table starts.

Check the parse tree to see it:

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.acmlm.org%2Fbeta%2F&charset=%28detect+automatically%29&doctype=Inline&sp=1

Micha

Alan J. Flavell

unread,
May 10, 2006, 7:39:23 AM5/10/06
to
On Wed, 10 May 2006, Michael Fesser quoted:

> 94: <p class='center'>

(There's nothing really to add to the accurate answers already posted
to the main question, but this side-issue prompts me to comment
anyway.)

class='center' ? - Let's hope that the speaking browser is
stereophonic, then.

As a general rule, I'd have to recommend choosing class names for
their significance to the content's structure, rather than to one
particular range of presentation possibilities. The latter is what
alternative stylesheets are for. Consider the principle of separating
content (marked up for what it is in HTML) from presentation (proposed
in CSS).

best

Chris Morris

unread,
May 10, 2006, 7:43:35 AM5/10/06
to
"Alan J. Flavell" <fla...@physics.gla.ac.uk> writes:
> class='center' ? - Let's hope that the speaking browser is
> stereophonic, then.

Not that I know of anything that supports it, but:
http://www.w3.org/TR/CSS2/aural.html#spatial-props
.center { azimuth: center; elevation: level; }



> As a general rule, I'd have to recommend choosing class names for
> their significance to the content's structure

Of course.

--
Chris

Lars Eighner

unread,
May 10, 2006, 7:52:53 AM5/10/06
to
In our last episode,
<TWc8g.14546$Lm5....@newssvr12.news.prodigy.com>,
the lovely and talented Joshua Franco
broadcast on comp.infosystems.www.authoring.html:

> 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 validator's
> indication of "Line 112, column 3: end tag for element "P" which is not open
> ." appears to be in error. The tag IS open at that point. That line closes
> it.

No. It isn't. TABLE is a block element. It implicitly closed P.

> Please advise as to why the validator would behave incorrectly like this.

The validator is exactly right. Learn some HTML.

--
Lars Eighner use...@larseighner.com http://www.larseighner.com/
"I have never made but one prayer to God, a very short one: 'O Lord,
make my enemies ridiculous.' And God granted it." --Voltaire

Jukka K. Korpela

unread,
May 10, 2006, 8:56:24 AM5/10/06
to
Joshua Franco wrote:

> I am having trouble with the W3C html validator.

You have a problem in writing valid HTML. The validator is there to help
you with that problem. However, the validator basically points at
errors; it is not a teacher or a tutor. You need to use its output to
see the errors and then consult specifications and reliable tutorials on
how to right syntactically (and otherwise) correct HTML.

> Please advise as to why the validator would behave incorrectly like this.

I wonder why you say so and why you have included the "W3C HTML 4.01"
icon, claiming validity, when in fact clicking on the link reveals that
the page is not valid. Do you always claim conformance to some rules in
public and _then_ start checking for actual conformance, even without
removing the false claim immediately after discovering that it is false?

Of course, this is just another proof for my statement that "Valid HTML"
icons and relatives are worse than useless: they add nothing to the
value, the create enigmas and distraction, and they are quite often
false, or even lies.

Jack

unread,
May 10, 2006, 9:33:12 AM5/10/06
to
Jukka K. Korpela wrote:
>
> Of course, this is just another proof for my statement that "Valid
> HTML" icons and relatives are worse than useless: they add nothing to
> the value, the create enigmas and distraction, and they are quite
> often false, or even lies.

They're basically just ads. As such, nobody (surely?) thinks they are
"true", whatever than means in this post-modern world. They certainly do
create distraction; but that's in the nature of ads.

I'm not so sure about enigmas. I don't think they're any more enigmatic
than any other superfluous graphic, but YMMV. Perhaps if one has an
overriding obsession with validity, they might initially tend to cause
some confusion, especially if one is inclined to believe everything one
reads.

--
Jack.

Harlan Messinger

unread,
May 10, 2006, 10:54:57 AM5/10/06
to
Joshua Franco wrote:
> 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 validator's
> indication of "Line 112, column 3: end tag for element "P" which is not open
> ." appears to be in error. The tag IS open at that point.

You need to understand the distinction between elements and tags. An
HTML document consists of elements that contain other elements: HTML,
BODY, LINK, FORM, P, A, etc. There are rules for which elements contain
which elements.

Tags are used to mark the start and end of an element, but in some cases
the end tag (and sometimes the start tag, in the case of the HTML, HEAD,
BODY, and TBODY elements) have been made optional. An element with an
optional end tag is treated as ending when a new element is reached that
can't be contained inside the current element, and also when the end of
an element that contains it is reached. That's why you can have

<body><p>paragraph 1<p>paragraph2<p>paragraph3</body>

The first two P elements are understood to end when the following ones
begin. The last P element is understood to end when the BODY element
that contains it ends.

You have a P start tag followed by a TABLE start tag. A P element can't
contain a TABLE element, so the P element is treated as having ended
just before the TABLE tag. Therefore, when you reach the </p>, there
isn't an open P element for it to close.

0 new messages