Entity Declarations

Entities are simply a method of shorthand for including information in an XML document which is either repeated often or specialized characters.

For example, let's say that we were working on a set of legal documents, and we wanted to include a disclaimer in those documents, and we wanted to repeat it many times (at the top and bottom of each page, for example). We could insert the entire disclaimer word-for-word multiple times in the document, or we could use an entity.

When entities appear in an XML instance document, they look like this:

<element>&entity;</element> 

The ampersand & denotes that the text is an entity, and the semicolon ; denotes the end of the entity. The entity represents the name of the entity, as defined ...

Get Special Edition Using XML, Second 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.