Name
<!DOCTYPE>
Synopsis
<!DOCTYPE
root-element
SYSTEM|PUBLIC
[name]
URI-of-DTD
>
Description
The <!DOCTYPE> instruction allows you to specify a DTD
for an XML document. This instruction can currently take one of
two forms:
<!DOCTYPE root-element SYSTEM "URI_of_DTD"> <!DOCTYPE root-element PUBLIC "name" "URI_of_DTD">
Keywords
-
SYSTEM The
SYSTEMvariant specifies the URI location of a DTD for private use in the document. The DTD is applied to all elements inside of root_element. For example:
<!DOCTYPE <Book> SYSTEM "http://mycompany.com/dtd/mydoctype.dtd">
-
PUBLIC The
PUBLICvariant is used in situations where a DTD has been publicized for widespread use. In those cases, the DTD is assigned a unique name, which the XML processor may use by itself to attempt to retrieve the DTD. If that fails, the URI is used:
<!DOCTYPE <Book> PUBLIC "-//O'Reilly//DTD//EN" "http://www.oreilly.com/dtd/nutshellbook.dtd">
Public DTDs follow a specific naming convention. See the XML specification for more details on naming public DTDs.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access