You are here: Re: What's wrong with this HTML (fails validation) ? « HTML « IT news, forums, messages
Re: What's wrong with this HTML (fails validation) ?

Posted by Jukka K. Korpela on 02/14/07 08:04

Scripsit robert maas, see http://tinyurl.com/uh3t:

>> The useful thing is that the validator reports the existence of an
>> error.
>
> That's not very useful at all when the error is reported several
> thousand lines after where the actual error happened.

Not very useful, but useful. Knowing whether there is an error or not is
more information than not knowing whether there are errors or not.

Of course error messages should be compact, informative, to the point, and
related to the very construct that is in error. But error diagnostics is
difficult. It takes time and effort to create a good diagnostic system, and
it requires a good understanding of both the language rules and the ways
people typically break them. (In my wild youth, I wrote major parts of a
Pascal compiler, including error processing, and I still remember it was
rather difficult to be correct and helpful at the same time.)

In the case on "<p />" (by the formal SGML-based rules of classic HTML), the
formal error is where it was reported to be. "<p /a long string/" is
formally valid. You must not report an error when there is none. What you
could conceivably issue is a _warning_ on pragmatic grounds, and that's what
the WDG validator does. (If I remember correctly, the warning was added
according to my suggestion and was actually related to a different issue,
namely constructs like <a href=/foo>, where the formal error is quite
different from what really went wrong.)

>> Checking is not a substitute for learning and understanding.
>
> Are you claiming that you've never made even one mistake in your
> entire life?

My modesty prevents me from doing so. :-)

Seriously, I don't see why you imply such a claim in my statement.

> So a utility that checks for mistakes in your work is
> totally worthless?

On the contrary. A utility that reports mistakes (even on a "There is an
error" basis, though naturally I prefer more exact reports) is often
essential, but it is not a _substitute_ for learning and understanding.
Rather, an incentive and tool for them.

Compare this with spelling checkers. When I wrote serious texts to be
published in print media, I almost always use Microsoft Word with all
possible spelling and grammar checks enabled, even when I write rather
technical texts with lots of special terms that will be flagged by the
checks. But I do not blindly make the changes that the checkers suggest.
Rather, I treat them just as input to my own checking and judgement. I
occasionally even decide to use expressions flagged as "poor style", but
consciously and after due consideration. And if Word flags an entire
sentence in a manner that effectively says "hey, this went over my head, the
sentence is too complicated", I'm grateful for the information and don't
require it to tell _where_ its analysis broke. Rather, I read the sentence
carefully and then usually reformulate it, typically breaking it to two
sentences.

> I guess you're super-human

I'm not particularly interested in arguing with you, but I sense some
arrogance in your statements where you seem to accuse me of arrogance.

> Your snobbish attitude

Of course I'm a snob, but the parenthetic statement is all yours:

> (if one ever make even one mistake then that
> person is an idiot who needs to learn more, rather than a human who
> makes mistakes)

Idiots, by definition, cannot learn much. All human people should learn more
every day to the extent they can. Reports about mistakes can be taken as
suggestions about possible needs for learning, or you might get crazy and
babble and drool _like_ an idiot. I have much sympathy for idiots, but not
that much for people who just act like idiots.

> Interlude:

Excuse me while I yawn.

>> It would be an error to flag a valid document as erroneous.
>
> On the other had, "transitional" means something that bridges the
> gap between two slightly different systems, so if it flagged
> something that was valid in SGML/HTML but not valid in XHTML/XML or
> vice versa that would be very helpful.

Both "Transitional" and "Strict" are strictly defined formal syntaxes. If
"it" refers to a validator, then you are asking for a validator to do
something else than act as a validator. And maybe it _is_ useful to add
heuristic pragmatic warnings to validators, but the statement "It would be
an error to flag a valid document as erroneous". A program purported to be a
validator could be _more_ than a validator, but it should not be _less_.

> My conclusion at this point is that there is *no* way to force a
> line break in the middle of a paragraph without actually forcing a
> full paragraph break which implies a **BLANK*LINE** between
> paragraphs. If anybody knows a way, please tell.

What? I think this was already discussed, and I have no idea how you think
it is related to the formal aspects being discussed.

A paragraph break implies a blank line only by default rendering rules of
(typical) visual browsers. These days, you can easily use CSS to set the
relevant properties (margin-top and margin-bottom for applicable elements)
to zero, with the usual CSS caveats of course.

Moreover, you can use <br> (or <br /> if you use XHTML for some odd reason)
for a simple line break. Or you could use display: block in CSS, as someone
suggested in this discussion, I think.

> Warning: net-enabling start-tag; possibly missing required
> quotes around an attribute value
> Will somebody please tell me what "net-enabled" means here??

In this context, "net" (better written as "NET") means "null end tag". When
you have "<p /", you have a NET-enabling start tag, i.e. a start tag that
makes the next "/" act as the end tag for the element that was opened. It's
a nice idea in SGML, but it was never implemented in HTML browsers, even
though it was formally part of HTML up to and including HTML 4.01.

> I clicked on the link for the p element:
> The P element defines a paragraph. The closing tag for P is
> optional, but its use prevents common browser bugs with style
> sheets. ...
> What does "optional" mean???

It means something that may be used, upon your decision. That is, the word
has the same meaning as in ordinary English.

> The "Web Design" instructor emphasized
> that every opening tag requires a matching (and properly nested)
> closing tag. Only empty tags can stand alone.

That was simply teaching XHTML. It's not that serious as such - one of the
books I've co-authored teaches XHTML in a fairly systematic way and even
carries "XHTML" in its name, though it also explains the real scope of
applicability of XHTML. It does no harm to follow such rules, as long as you
are careful with empty elements and don't mix classic HTML and XHTML and
expect validators to grok it. But it may prevent people from understanding
that in classic HTML, many end tags _are_ optional (omissible) and routinely
omitted without casualties.

> * Line 81, character 55:
> .. keyword cited there.<br></br>
> ^
> Error: end tag for element BR which is not open; try removing
> the end tag or check for improper nesting of elements
> It looks open to me, per XML/XHTML standards!!

Well, did you _declare_ that you use XHTML? I don't think so. If your
document type declaration declares an HTML 4.01 doctype, then SGML rules
apply. By SGML rules and by the declaration for the br element (with EMPTY
declared content), <br> is "self-closing", i.e. the element always has empty
content and must not have an explicit end tag. Therefore, </br> is always an
error.

> Clearly I'll have to
> totally avoid the br element in my Web pages.

So _that_ is how you jumped into a conclusion earlier.

> <br />&nbsp;<hr />
> ^
> Warning: net-enabling start-tag; possibly missing required
> quotes around an attribute value
> How the fuck do I get a horizontal rule any more???

By using <hr>. Alternatively, by setting a top or bottom border for an
element. There are other techniques like images and background images too,
if you want to create a decorative rule.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация