Entities

In the previous chapter, we received an introduction to the idea of entities in XML documents. Two kinds of entities exist: 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, but parameter entities, which you use in a document's DTD, are also available and are 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 Inside 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.