Entities are an important component in SGML document instances. They are used for a number of different purposes:
- To contain frequently used fragments of parsable text so they can be entered into a document in a number of places simply by referencing the entity by name instead of duplicating the entire text.
- To contain fragments of parsable text that are used in a number of documents. The entity declaration can be placed in a common file that can be included in the Document Type Declarations of each document. If the text changes, it only needs to be updated in one place.
- To "stand in" for characters which do not have a direct representation in the editing environment used to create the document.
- To "stand in" for characters which must be represented in different ways on different target systems or in different target formats.
- To reference subdocuments which may conform to a completely different DTD.
- To reference graphics or other non-parsable data in external files.
- Internal text entity references are automatically replaced with their replacement text by the SGML parser. The OmniMark programmer need do nothing special to handle these. In general, internal entities which require application-specific processing should be encoded as SDATA entities.
- Internal data entity references can be captured by patterns in
translate
rules. These types of entities are often used to represent text characters which otherwise could not be represented in the document. Such characters often require special handling.
- External text entity references will automatically be processed by the SGML parser if they are declared with a system identifier that is a valid file name on the current system, or if they are declared with a public identifier that has a
library
rule that maps it to a system identifier which identifies a valid file name on the current system. A programmer can provide alternative behavior by specifying an external-text-entity
rule to handle external text entities explicitly.
- External data entity references are not processed by the SGML parser. If the application needs to do something with these entities, an
external-data-entity
rule must be provided in the program to implement the required behavior.
- Attributes of the type ENTITY or ENTITIES are validated by the SGML parser. The OmniMark program can specify additional processing for the values of such attributes.
Generated: April 21, 1999 at 2:00:47 pm
If you have any comments about this section of the documentation, send email to [email protected]
Copyright © OmniMark Technologies Corporation, 1988-1999.