Doctype - Save a copy, or link to w3c?

Discussion in 'HTML & Website Design' started by Josh Inno, Feb 5, 2007.

  1. #1
    I've noticed that it's possible to download a copy of the standards available on w3c's website , save them to a folder on my own site, and link directly to them.

    Is this a desirable thing to do, or a stupid/buggy thing to do?

    I can see a few benifits:

    If there is a net disconnect, power outage, or intrusion, and the user can't get to w3.org, the user viewing my site can still use the doctype on my site.

    If w3 updates, I still know that my doctype and site match each other.

    I'm sure there are some downsides I'm missing, but the only one I can see is that there'd be more bandwidth coming out of my server.
     
    Josh Inno, Feb 5, 2007 IP
  2. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would just link to it, don't think there is much of a risk in that.
     
    ServerUnion, Feb 5, 2007 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    The browser does not read the DTD. The html DTD is built into the browser, and that includes non extended xhtml served as text/html. What the browser does do is use the DTD as a trigger to determine whether to use quirks, near standard or standard mode to render the page. That is vendor specific.

    A complete and proper DTD, triggering standards mode, means that IE just might follow the rules well enough simulate being a good browser.

    Access to the DTD is necessary when using extended xhtml or xml other than xml 1.0 or one of the other standard xml DTDs.

    To see an example of an extended DTD, see this xhtml doc. Note that the browser reads the extension and renders as defined. A validator will not validate, as it doesn't read the extension.

    You will need to use a modern browser to view the xhtml page. IE is an obsolete PoS, and doesn't support xhtml.

    cheers,

    gary
     
    kk5st, Feb 5, 2007 IP
  4. Josh Inno

    Josh Inno Guest

    Messages:
    1,623
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    So when using an xml or xhtml dtd, it is actually read. So where would it be better to have it be read from? Or am I missing the point to your post?
     
    Josh Inno, Feb 5, 2007 IP
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    Your browser knows html, xhtml and the very limited xml1.0. It doesn't read it anywhere. The DTD, in x/html, serves no purpose other than to trigger standards mode.

    If you use the extensible abilities of xml or xhtml, you must tell it where to look for the definitions. In my example (did you look at the source?), the extensions are made part of the DTD declaration. Don't worry about that part. With IE's stupidity, there is little practical value to extending html; it's just an ego thing to show everyone how cool I am. :D

    cheers,

    gary
     
    kk5st, Feb 5, 2007 IP
  6. Josh Inno

    Josh Inno Guest

    Messages:
    1,623
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #6
    So in other words, it doesn't matter where I link it to, since it won't be read from that location. So putting it on my server only wastes my server space.
     
    Josh Inno, Feb 6, 2007 IP
  7. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #7
    Use the DTD as is.
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" 
      "http://www.w3.org/TR/html4/strict.dtd">
    
    or
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    Code (markup):
    That's it.

    gary
     
    kk5st, Feb 6, 2007 IP
  8. Josh Inno

    Josh Inno Guest

    Messages:
    1,623
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #8
    *nods* Right, right. Although on some pages I'm afraid I'll be using transitional/loose for a bit yet.
     
    Josh Inno, Feb 6, 2007 IP
  9. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #9
    Me too, currently I'm using:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    
    Code (markup):
    I've tried XHTML:

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    Code (markup):
    But the validator (http://validator.w3.org/) is too extrict for XHTML.
     
    ajsa52, Feb 6, 2007 IP