Document type declaration
The document type declaration contains or points to markup
declarations that provide a grammar for a class of documents. This
grammar is known as a document type definition, or DTD. The document
type declaration defines constraints on the sequence and nesting
of tags, attribute values, names and formats of external references,
and so forth. You
can edit the document type declaration to change its name, but the
name must always be the same as the name of the root element. Changing
the name in either the document type declaration or the root element
automatically changes the name in the other.
Adding DTDs
You can add an identifier pointing to an external DTD subset,
and you can add an internal DTD subset. If you supply both external
and internal subsets, entity and attribute-list declarations in
the internal subset take precedence over those in the external subset.
Public identifiers
An external identifier can include a public identifier that
an XML processor can use to generate an alternative URI. If an alternative
URI cannot be generated, the URI provided in the system identifier
is used. External identifiers without a public identifier are preceded
by the keyword SYSTEM. External identifiers with
a public identifier are preceded by the keyword PUBLIC.
Exporting metadata
If you specify a system or public identifier and/or
an internal subset in the Document Type Declaration dialog box,
a DTD cannot be generated when the data is exported to XML. A MetaDataType
of XMLDTD! is ignored. For more information about the properties
that control the export of metadata, see “Exporting metadata”.
Examples
These are examples of valid document type declarations.
An external system identifier:
|
1 |
<!DOCTYPE d_dept_listing SYSTEM "d_dept_listing.dtd"> |
An external system identifier with a public identifier:
|
1 |
<!DOCTYPE d_test PUBLIC "-//MyOrg//DTD Test//EN"<br>"http://www.mysite.org/mypath/mytest.dtd"> |
An external system identifier with an internal DTD. The internal
DTD is enclosed in square brackets:
|
1 |
<!DOCTYPE d_orders <br>   SYSTEM "http://www.acme.com/dtds/basic.dtd"[<br>   <!ELEMENT Order (Date, CustID, OrderID, Items*)><br>   <!ELEMENT Date (#PCDATA)><br>   <!ELEMENT CustID (#PCDATA)><br>   <!ELEMENT OrderID (#PCDATA)><br>   <!ELEMENT Items (ItemID, Quantity)><br>   <!ELEMENT ItemID (#PCDATA)><br>   <!ELEMENT Quantity (#PCDATA)><br>]> |