|
|||||
Entities: matching based on both name and replacement text | |||||
Prerequisite Concepts | Related Syntax |
A match can be based on both the name and the replacement text of an internal entity.
During the development of an application, it is a convenient and commonly used convention to define character-representing internal SDATA entities with a fixed value, such as "TBD" or "[default]". A rule that matches all such entities, and only those, (and which extracts the selected entities' names) is:
translate sdata valued "tbd" named any+ => entity-name output "{\ul %x(entity-name)}"
If both an entity's name and replacement text are to be matched, then the patterns for both the value and the name must match. The named
and valued
keywords (and the patterns that follow them) can be used in either order (either named
or valued
can be used first).
Matching both a name and a value is especially convenient when the "default" SDATA value is associated with the default general entity, so that all "undefined" entities and their names are captured by a rule such as the one above. This avoids the requirement to anticipate all entities that a user may need during the development of an OmniMark program -- specific processing can be added at a later time.
Prerequisite Concepts Entities Pattern matching |
Related Syntax translate |
---- |