<html> tag missing, but still validating

Discussion in 'HTML' started by windandwaves, Oct 6, 2005.

  1. windandwaves

    windandwaves Guest

    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
    windandwaves, Oct 6, 2005
    #1
    1. Advertising

  2. On Fri, 07 Oct 2005 00:52:05 +0200, windandwaves <>
    wrote:

    > 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 |
    `-------------------------------------------------- --<--@ ------------'
    Barbara de Zoete, Oct 7, 2005
    #2
    1. Advertising

  3. windandwaves

    Mark Parnell Guest

    In our last episode, Barbara de Zoete <>
    pronounced to alt.html:

    > <!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.

    --
    Mark Parnell
    http://clarkecomputers.com.au
    alt.html FAQ :: http://html-faq.com/
    Mark Parnell, Oct 7, 2005
    #3
  4. windandwaves

    windandwaves Guest

    Mark Parnell wrote:
    > In our last episode, Barbara de Zoete <>
    > pronounced to alt.html:
    >
    >> <!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.



    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?
    windandwaves, Oct 7, 2005
    #4
  5. windandwaves

    Mark Parnell Guest

    Mark Parnell, Oct 7, 2005
    #5
  6. windandwaves

    Toby Inkster Guest

    Barbara de Zoete wrote:

    > <!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.)

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Oct 7, 2005
    #6
  7. On Fri, 07 Oct 2005 01:36:49 +0200, Mark Parnell
    <> wrote:

    > In our last episode, Barbara de Zoete <>
    > pronounced to alt.html:
    >
    >> <!ELEMENT HTML O O (%html.content;) -- document root element -->

    >
    > 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 |
    `-------------------------------------------------- --<--@ ------------'
    Barbara de Zoete, Oct 7, 2005
    #7
  8. windandwaves

    rf Guest

    Toby Inkster wrote:

    > 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 :)

    --
    Cheers
    Richard.
    rf, Oct 7, 2005
    #8
  9. windandwaves

    Andy Dingley Guest

    windandwaves wrote:

    > 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:
    Andy Dingley, Oct 7, 2005
    #9
  10. windandwaves

    Jim Higson Guest

    windandwaves wrote:

    > Mark Parnell wrote:
    >> In our last episode, Barbara de Zoete <>
    >> pronounced to alt.html:
    >>
    >>> <!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.

    >
    >
    > 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
    Jim Higson, Oct 7, 2005
    #10
  11. windandwaves

    Andy Dingley Guest

    Jim Higson wrote:

    > 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.
    Andy Dingley, Oct 7, 2005
    #11
  12. windandwaves

    Toby Inkster Guest

    Jim Higson wrote:

    > 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.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Oct 8, 2005
    #12
  13. windandwaves

    Lachlan Hunt Guest

    Andy Dingley wrote:
    > 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


    --
    Lachlan Hunt
    http://lachy.id.au/
    http://GetFirefox.com/ Rediscover the Web
    http://GetThunderbird.com/ Reclaim your Inbox
    Lachlan Hunt, Oct 8, 2005
    #13
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. darrel
    Replies:
    6
    Views:
    456
    darrel
    Oct 15, 2004
  2. shruds
    Replies:
    1
    Views:
    746
    John C. Bollinger
    Jan 27, 2006
  3. Jim Whitehead
    Replies:
    0
    Views:
    356
    Jim Whitehead
    Aug 15, 2003
  4. Replies:
    1
    Views:
    360
    Andrew Thompson
    Nov 29, 2006
  5. Replies:
    3
    Views:
    177
Loading...

Share This Page