Entities within entities

The replacement value of an entity can itself contain entity references. In this way, a hierarchy of entities may be built, beginning with the document entity. However, entity content cannot contain declarations for the entities they reference. The declarations must all be known to the main document. In the following example, the document must declare both A and B entities, even though it directly references only the first of these:

However, it is not permitted for an entity to directly or indirectly contain a reference to itself (a cyclical relationship would confuse XML processing software).

In this example, the TimeCorp ...

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.