Entity references

Usually, an entity reference is a simple markup construct that begins with an ampersand character, '&', and ends with a semicolon, ';'. The body of the construct is a reference to the name of the entity. The following example is a reference to an entity called 'XML' (which might have a replacement value of 'eXtensible Markup Language'):

The &XML; format is useful.

SGML Note

The semicolon is always required, even when followed by a space.

The entity reference is detected by an XML parser as it reads the data, and is removed. Its place is taken by the replacement value, which is then also parsed as if it had always been an integral part of the document:

Entities can also be referenced from attributes (with some limitations): ...

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.