HTML and CSS Reference
Table H-19 DTD Data Type Attributes
Specific value set at the default attribute value
Attribute value is fixed and must always take the default value assigned
Attribute value is optional; if used in an element type, no default value is supplied
Attribute value must be specified with the element
As just discussed, a DTD can also include entity declarations , which assign a name
to a block of text or other characters that can be interpreted as markup language and
substituted in a document. The replacement text must begin with an ampersand (&) and
end with a semicolon (;). Entity declarations can be internal or external. Table H-20 shows
the general form of an internal entity declaration. Table H-21 shows the predefined symbols
that can be used in an entity declaration.
Table H-20 General Form of Internal Entity Declaration
<!ENTITY name "&replacement;">
The attribute name is a valid element name and replacement is the entity characters to be
substituted within the string. Circular references are not allowed.
<!ENTITY copyright "©">
<PUBLISHED>2014 Cengage Learning ©right;</PUBLISHED>
Table H-21 Predefined Entity Symbols
Cannot be used in processing instructions
Use with attributes beginning with quotation marks
Use after ]] in normal text and processing instructions
Use in attributes within double quotation marks
Use in attributes within single quotation marks
&#x hex ;
Where hex is replaced with a hexadecimal value for a character, such as
A9 for the copyright symbol (©)
XML allows the use of external entities to refer to the contents of another file.
An external entity exists at a specified location or URL. The content of the external
file is inserted at the point of reference and parsed as part of the referring document.
Table H-22 shows the general form of an external entity.
Table H-22 General Form of an External Entity
<!ENTITY name PUBLIC/SYSTEM "URI/URL">
<ELEMENT>text "&replacement;" </ELEMENT>
The attribute name is a valid element name; the URI or URL is an identifier that points to a file
on that system or a public file available via URL. ENTITY must be declared first.
<!ENTITY stockquotes SYSTEM
<dowjones>Dow Jones Industrial Averages</dowjones>