I was just wondering when I declare a Doctype such as the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Is strict.dtd read from http://www.w3.org/TR/html4/ or is this just used as an obscure id to tell the browser to use strict processing?
Maybe the browser keeps the content of http://www.w3.org/TR/html4/ permanently stored locally?
Normal web browsers treat the Doctype as nothing more than a magic string to indicate standards mode or quirks mode. They do not treat the URI as a URI and never download the DTD. They don't even use the DTD for parsing, having a tag soup parser built in instead.
Validating parsers do download it if they don't have a local copy which they can identify based on the PUBLIC identifier (the URI is the SYSTEM identifier). They should cache it, but lots don't, to the point where the W3C block most (if not all) requests for the DTD at the URIs given in the Doctypes — they couldn't afford the bandwidth.
This is an extract from the wikipedia page for "DTD"
Since web browsers are implemented with special-purpose HTML parsers, rather than general-purpose DTD-based parsers, they don't use DTDs and will never access them even if a URL is provided
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With