For ease of writing DTDs themselves and for providing a
macro facility to be used in XML documents, we have in
the DTDs to ways of defining entities. But before describing
them, you must know that 5 entities are part of the XML:
<, >, ",
&, and ', respectively representing the following characters
<, >, ",
&, and '. Others,
so called general entities may be defined
by you as follows:
<!ENTITY copy "©">
Or, more macro like
<!ENTITY copyright "© 2004 by Triple Dog Dare Media">
The former being used in XML such as ©, while
the latter applies as
<footer>©right;</footer>
For use in writing DTDs in a more optimal way, we have the xo called parameter entities. Take a look at
<!ENTITY % acceptable "(#PCDATA|b|i|u|citation|dialog)">
<!ELEMENT paragraph %acceptable;>
<!ELEMENT intro %acceptable;>
<!ELEMENT sidebar %acceptable;>
<!ELEMENT note %acceptable;>
The usage is being amply illustrated by the XHTML DTD you will see in todays assignment 3.0.
Finally you have the rather powerful possibility of using external entities referring to not local network resources such as in
<!ENTITY favoritequotes SYSTEM "http://www.deformation.org/fortune">
Tbe used as in
<section>
<heading>My favorite jokes</heading>
&favoritequotes;
</section>