<html> tag missing, but still validating

W

windandwaves

Hi Folk

Please have a look at :

http://validator.w3.org/check?uri=http://www.historymakers.co.nz/

The page validates (except for oversrc, which is meant to be there
(Javascript)).

HOWEVER, i just noticed I did not use the starting html tag (there is a
</html> at the end), yet no mention of it.

This is the head of the page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>History Home ::: Top 100 New Zealand History Makers - Prime
TV</title>
<link rel="stylesheet" type="text/css" href="s/drop.css">
<link rel="stylesheet" type="text/css" href="s/s.css">
<link rel="stylesheet" type="text/css" href="s/moz.css">
<script type="text/javascript" src="j/drop.js"></script>
<script type="text/javascript" src="j/j.js"></script></head>Why is the
validator not picking up the missing <html> tag or is the first line the
html tag?


TIA

- Nicolaas
 
B

Barbara de Zoete

Hi Folk

Please have a look at :

http://validator.w3.org/check?uri=http://www.historymakers.co.nz/

The page validates (except for oversrc, which is meant to be there
(Javascript)).

HOWEVER, i just noticed I did not use the starting html tag (there is a
</html> at the end), yet no mention of it.
Why is the
validator not picking up the missing <html> tag or is the first line the
html tag?

It's not. From the DTD:

<!--================ Document Structure ==================================-->
<!ENTITY % html.content "HEAD, BODY">

<!ELEMENT HTML O O (%html.content;) -- document root element -->
<!ATTLIST HTML
%i18n; -- lang, dir --

--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
 
M

Mark Parnell

<!ELEMENT HTML O O (%html.content;) -- document root element -->

And for those who can't read a DTD...go and learn. ;-)

Just kidding (though it is worthwhile) - the O O after the element name
means that both the opening and closing tags are optional.
 
W

windandwaves

Mark said:
And for those who can't read a DTD...go and learn. ;-)

Just kidding (though it is worthwhile) - the O O after the element
name means that both the opening and closing tags are optional.


hmmm, that starts to make sense now. I like w3 but I never know how to find
things. There are so many different standards and options, etc... How do
you tackle this and where can I learn the DTD codes?
 
T

Toby Inkster

Barbara said:
<!ELEMENT HTML O O (%html.content;) -- document root element -->

And it's also in the plain English bit:

http://www.w3.org/TR/html401/struct/global.html#h-7.3

| 7.3 The HTML element
| [...]
| Start tag: optional, End tag: optional

Similarly, the start and end tags for HEAD and BODY are optional. A valid
HTML 4.01 Strict page can consist of as few as three tags, plus DOCTYPE:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<TITLE>Example</TITLE>
<P>Example

HTML 4.01 Transitional doesn't even need the <P>. Transitional allows
inline text to sit directly inside the BODY, whereas Strict says that you
can only have block-level elements inside BODY.

Note though, that valid HTML does need a BODY *element*. It's just that
the <BODY> and </BODY> *tags* to explicitly show where the BODY element
starts and ends are optional -- the element exists without them. (Ditto
HTML and HEAD elements.)
 
B

Barbara de Zoete

And for those who can't read a DTD...go and learn. ;-)

Well, you could do that. Or, if you don't understand, you can just ask 'Hey,
that sounds great, but what the heck does it mean.'
Just kidding (though it is worthwhile) - the O O after the element name
means that both the opening and closing tags are optional.

Which would be a good answer to that question. :)


--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
 
R

rf

Toby said:
Note though, that valid HTML does need a BODY *element*. It's just that
the <BODY> and </BODY> *tags* to explicitly show where the BODY element
starts and ends are optional -- the element exists without them. (Ditto
HTML and HEAD elements.)

And this goes for several other elements as well like tbody. Got caught out
royally when I first started looking for td elements by grazing through a
tables children. None there, of course :)
 
A

Andy Dingley

windandwaves said:
I like w3 but I never know how to find things.

DTDs pre-date the W3C. Like any well-behaved standards body (*), the
W3C are careful not to duplicate anyone else's existing standards. If
you do this, you end up with wrong-headed contradictions (like the ISO
HTML imposition of ordered <h*>)

So DTDs are an old SGML feature. Reading their definition is going to
need a trip into that particular dinosaur-filled tarpit. There's almost
certainly a book by Charles Goldfarb that you can't afford. Perhaps one
of the local (or c.i.w.a.h) SGML gurus can point us at a handy web
guide instead - I'd certainly appreciate one.

(*) I said _like_. I know they're not :cool:
 
J

Jim Higson

windandwaves said:
hmmm, that starts to make sense now. I like w3 but I never know how to
find
things. There are so many different standards and options, etc... How do
you tackle this and where can I learn the DTD codes?

Btw, might be easier to learn XML DTDs than straight SGML ones. Since XML is
really just a simpler subset of SGML there'd be less to learn (in this case
the O O wouldn't be there because there are no optional open/close tags)

With this you understand the DTDs for XHTML, RSS, SVG etc...

Jim
 
A

Andy Dingley

Jim said:
Btw, might be easier to learn XML DTDs than straight SGML ones.

Does anyone still use XML DTDs?

Serious XML work is generally using Schema (and long has done). XHTML
can't be used unless you understand the SGML issues of
XHTML-as-text/html, so there's little saving there. Did RSS (any
version beyond 0.9*) ever have a DTD? Atom has gone to RelaxNG
instead.
 
T

Toby Inkster

Jim said:
With this you understand the DTDs for XHTML, RSS, SVG etc...

Though the XHTML 1.1 DTD is an over-complicated mess. Almost impossible to
read.
 
L

Lachlan Hunt

Andy said:
So DTDs are an old SGML feature. Reading their definition is going to
need a trip into that particular dinosaur-filled tarpit. There's almost
certainly a book by Charles Goldfarb that you can't afford. Perhaps one
of the local (or c.i.w.a.h) SGML gurus can point us at a handy web
guide instead - I'd certainly appreciate one.

This is a good, fairly in depth SGML and HTML guide
http://www.is-thought.co.uk/book/home.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top