Parameter entities

Entities can also be used to assist with the construction of the rules that govern the document. But a different category of entity is required for this purpose. A parameter entity cannot be referenced from within a document, but can be referenced from within the document type declaration in order to help build the content of this important preamble to the document.

Declaration and reference

Parameter entities are declared in similar fashion to general text entities. The replacement value may be held in the declaration, or in an external file, in exactly the same way. The only difference in the declaration is the presence of a '%' symbol before the entity name:

<!ENTITY % aParameterEntity SYSTEM "anEntity.ent" >

A reference ...

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.