|
|||||
External text entity rules: additional tests | |||||
Prerequisite Concepts | Related Syntax |
External text entities can be either general entities (introduced by "&") or parameter entities (introduced by "%"). Since external-text-entity
rules are processed for both general and parameter external text entities, be prepared to handle both kinds of entities.
If an entity has a system or public identifier (or both) it usually doesn't matter whether it's a general or parameter entity; the rules for finding the information referenced by the system identifier are usually the same.
However, if only an entity name is provided and the OmniMark program is written to use the entity name (as part of a file name, for example), the program can be set to find this information differently for general and parameter entities. The following two declarations demonstrate the difference:
<!ENTITY chapter1 SYSTEM -- text of the first chapter --> <!ENTITY % comdc1 SYSTEM -- common declarations -->
Two tests can be used in an external-text-entity
rule to distinguish between general and parameter entities:
entity is general entity is parameter
One of these two tests is always true of an entity in an external-text-entity
rule, so entity is general
is equivalent to entity isnt parameter
and entity is parameter
is equivalent to entity isnt general
.
These tests also can be used in the external-data-entity
rule, or with the entity
or entities
attribute values. However, in both cases, the entity is always a general entity.
An entity manager designer should note that, in general, parameter entity references usually occur in the DTD and general entity references usually occur in the document instance. There are, however, two exceptions to this general rule:
In summary, both general and parameter external entity references can occur in both the DTD and the document instance.
Prerequisite Concepts Entities Entities: tests Entity manager: built-in Entity managers: programmer-defined External entity rules External text entities: default processing |
Related Syntax external-text-entity |
---- |