/    Sign up×
Community /Pin to ProfileBookmark

DTD – full path why?

I’m curious, why does everyone use the full reference to the DTD in their doctype definitions, as shown below:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd“>

I see this all the time – I’ve never known anyone but me to use the shortcut (relative path) – is there something I don’t know??? I mean ALL the DTD’s are shipped with ALL the browsers (this is an absolute requirement), so why use the full path?

to post a comment
Full-stack Developer

5 Comments(s)

Copy linkTweet thisAlerts:
@SamMar 06.2004 — according to w3, [URL=http://www.w3.org/QA/2002/04/valid-dtd-list.html]these[/URL] are the only valid doctypes. whether or not the relative urls work, doesn't change the fact that they are incorrect
Copy linkTweet thisAlerts:
@spufiMar 06.2004 — A partial Doctype is basically saying, I'm going to follow theses rules, but I'm not going to tell you exactly what those rules are. Because of this, some browsers go into quirks mode, which can be a real pain depending upon the amount of CSS you use. At one time the W3C validator would allow parital Doctypes, but I believe that it doesn't anymore.
Copy linkTweet thisAlerts:
@toicontienMar 06.2004 — I think it's for two reasons.

  • 1. A partial doctype is used to throw browsers into quirks mode, but the partial doctype says "I'm going to code to W3 specs, but I'm going to include support for proprietary browser technology, and my page is written in tag soup, so Web browser? Please be forgiving."


  • A full doctype says, "I'm going to build this page according to W3 specs, maybe include some proprietary browser technologies that won't affect the layout in unsupporting browsers. But the basic syntax will be correct, i.e. all tags closed, etc. Web browser? Don't be forgiving for my sloppy coding."

  • 2. Future browsers might have the ability to download the doctype files specified in the doctype tag. That would allow browsers to support other markup languages than just HTML. The browser could download and cache DTD files just like HTML, CSS, and graphics files. Kind of another move toward (x)HTML.
  • Copy linkTweet thisAlerts:
    @MikeOSMar 07.2004 — There isn't actually anything wrong with using the relative URL to the DTD. Check the link below and scroll down to section '3.1.1 Strictly Conforming Documents', (part 4) there you'll see examples of the relative path being used.

    http://www.w3.org/TR/2000/REC-xhtml1-20000126/

    This example is for XHTML 1.0 but you'll find examples for 1.1, and the various HTML DTDs if you dig around a bit.

    I believe most people don't use it as they don't know of its existence. Also it causes some debate as seen here. I normally stick with the absolute path to avoid all the trouble of explaining to others that it is perfectly valid.
    Copy linkTweet thisAlerts:
    @AdamGundryMar 07.2004 — Actually, if you look at the [url=http://www.w3.org/TR/xhtml1/#strict]latest version[/url] of that page, you will see that absolute URLs are used.

    The W3C can use relative URLs on their pages because their servers actually hold the DTD files. If you are using a public DTD, you should link to the version stored on the W3C servers; if you are using a system DTD, link to your locally stored version. The former is usual.

    Ada
    ×

    Success!

    Help @Crazy spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...