swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsSyntaxLibraries
 
Prerequisite Concepts      

External text entity rules: additional tests

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:

  1. In USEMAP declarations and in the specification part of marked section declarations (the bit between the first "[" and the second "[" in the document instance) only parameter entities can be referenced. These are considered declaration contexts, like the DTD, and can contain either internal or external parameter entity references, but not general entity references.
  2. Attribute values are considered "instance-like" whether they appear in the DTD (default values) or in the document instance (specified values) because, even if they are default values, they actually get used in the instance. No matter where they appear, only general entity references are recognized, and they can be internal or external entities.

In summary, both general and parameter external entity references can occur in both the DTD and the document instance.

Prerequisite Concepts
 
   
 

Top [ INDEX ] [ CONCEPTS ] [ SYNTAX ] [ LIBRARIES ]

Abridged OmniMark 9.1.0 Documentation Generated: November 11, 2010 at 3:52:02 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.