General entities

All entity types previously discussed are referenced from within XML documents, so are used to enhance the content of the document. All such entities are known as general entities. They can be used in a 'general' manner within documents.

An attribute value cannot be the name of a general entity (except for a binary entity). The following example will not identify the entity declared above (even when the DTD is configured to recognize the Owner attribute as identifying an entity). Indeed, this is considered to be a serious error:

         <!-- ERROR -->
<book owner="TimeCorp">...</book>

However, an attribute value may contain a reference to an internal entity (complete with '&' prefix and ';' suffix), though not to an external entity ...

Get XML Companion, The, Third Edition 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.