USING ENTITIES FOR SHARED TEXT

Entities can be used for other purposes. Another common usage is to define text that is repeated in lots of places that you don't want to type every time, or that you want to be able to easily change everywhere it is used. These are general entities that you define in the internal subset of your document and then use within your document.

For example, you are writing a document that frequently refers to the ANSI X.12 ASC 835 standard. This phrase must appear exactly as it is shown. Rather than type it out every single time, you define this entity:

<!DOCTYPE  MyDocuments PUBLIC "-//Joan Duvall//DTD Joan's Documents//EN" [
...
<!ENTITY ansi835 "ANSI X.12 ASC 835">
... ]>

Within the document, you use this entity every time you need to refer to the standard name. For example:

<paragraph>This interface follows the exchange protocols for &ansi835;
version 3070 for remittance information. </paragraph>

When the document is printed or processed by an SGML system for any type of output, the &ansi835; characters are replaced with ANSI X.12 ASC 835 instead.