Entities

In the previous chapter, we got an introduction to the idea of entities in XML documents. There are two kinds of entities: general entities and parameter entities. General entities are probably used by more XML authors because you use them in the content of your XML document. However, parameter entities, which you use in a document's DTD, are also available and very powerful.

So what exactly is an entity? An entity is simply XML's way of referring to a data item; entities are usually text, but they can also be binary data. You declare an entity in a DTD and then refer to it by reference in your document. General entity references start with & and end with ;. Parameter entity references start with % and end with ;. For text entities, ...

Get Real World XML 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.