General entities
In DTDs, an entity allows you to define a symbol for a value. In the Tree view, you can define general entities and parameter entities. The value of a general entity can be just about anything. It can be
- A short string that represents a longer string
- A way to include another marked-up file
- A reference to a graphical image
- A placeholder for some non-XML data or an expression that needs special formatting
General entities have names of the form &
, where the name follows the usual rules for XML names (above).name
;
To declare a general entity, use a declaration of this general form in your DTD:
<!ENTITYename
"text"
>
where ename
is the name of the entity you are defining (without the initial &
and final ;
), and text
is the text you want substituted for that entity.
For example, to define an entity named &cr;
with your copyright string, you might use a declaration like this:
<!ENTITY cr "Copyright (C) 1763 Cotton Mather LLP">