|
|||||
Entities: matching based on names | |||||
Prerequisite Concepts | Related Syntax |
Matching can be done on entity names, and whether or not a match succeeds is based on matching the name. For example, the following translate
rule succeeds for any internal CDATA or SDATA entity whose names consists of a single letter, and simply outputs the name of the entity in parentheses (the replacement text of the entity is ignored):
translate entity named letter => name output "(%x(name))"
A common use of the named
option in internal entity matches is to identify an SDATA entity by name. For example:
translate sdata named "amp" output "&"
As in the case for matching the replacement text of an internal CDATA or SDATA entity, the pattern that follows the keyword named
must match the whole of an entity's name.
Prerequisite Concepts Entities Pattern matching |
Related Syntax cdata sdata translate |
---- |