SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    $books++ == true matsko's Avatar
    Join Date
    Sep 2004
    Location
    Toronto
    Posts
    795
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Does a Browser actually download a DTD?

    I'm playing around with DTDs and I'm trying to figure out how to add my own tag declarations (like <cool></cool>), but I can't seem to figure out if the browser is actually downloading the DTD file and creating the tags accordingly.

    If I want IE to download the DTD and create the <cool> tag then would that work with a standard doctype? Is it possible to use more than one doctype for a xhtml file? Or do I need to concat two files into one?

    Or is it that a text/html file will not function like a xhtml file (using XML and doctypes and everything)?

    Am I fresh out of luck with IE ?
    I can't believe I ate the whole thing

  2. #2
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,692
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    The easiest way to test it, is to upload your own DOCTYPE, and check if it get any hits when you load your pages. The standard DOCTYPEs doesn't get downloaded, though, and I don't believe any custom ones do either.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    If you are serving the page as HTML then the doctype tag only serves as a switch to turn on standards mode. Everything in the doctype is ignored except that IE does use whether it is a strict or transitional doctype to decide where to load certain values for use by Javascript.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Agreed, most browsers simply ignore the contents of the DTD (they only use them for detecting standards and whether to use quirks mode).

    If you wanted to add some additional elements your best bet to achieve them would be through JavaScript (createElement) or through XSLT.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    If you want to add additional elements then you should use either XHTML or XML both of which are extensible (as HTML is not). If you want it to work with Internet Explorer you'd need to use XML as IE doesn't support XHTML.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •