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
SYSTEM
variant 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
PUBLIC
variant 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\(asReilly//DTD//EN" "http://www.oreilly.com/dtd/xmlbk.dtd">
Public DTDs follow a specific naming convention. See the XML specification for details on naming public DTDs.
Get XML Pocket Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.