Syntax
% format-modifier q
Purpose
The "%q" format item refers to the name of the currently opened element everywhere except in external-text-entity and external-data-entity rules. In functions, even if the function is called from an external-text-entity or an external-data-entity rule, the "%q" still refers to the currently opened element. This is to ensure that a function always behaves in the same way, regardless of what rule it is called from.
When referring to an element, the "%q" format can have the following modifiers:
- "l": converts all text to lowercase. Cannot be used with the "u" modifier.
- "u": converts all text to uppercase. Cannot be used with the "l" modifier.
- number "f": The field width modifier, "f" is allowed with the "%q" format. If the specified number is less than the minimum number of characters needed to format the value, the modifier is ignored. If it is greater, space characters are added to the right of the value to fill it out to the field width.
- "k": the right-justification modifier. It is allowed when the field-width modifier is given. It causes padding to be done on the left side of the field instead of the right. The "k" modifier requires the "f" modifier.
In entity rules, the "%q" format item only refers to the name of the current entity in the actions of an external-data-entity or an external-text-entity rule. It refers to the current element everywhere else, including in functions, as mentioned above.
The following modifiers can be used to return other information about a current entity.
- "e": causes OmniMark to access the system identifier from the entity declaration instead of the entity name.
- "o": causes OmniMark to access the notation name from the entity declaration instead of the entity name. This modifier can only be used in
external-data-entity rules because external text entities do not have a notation. This is the only format modifier that can be combined with the "f" or "k" format modifiers described above.
- "p": causes OmniMark to access the public identifier from the entity declaration instead of the entity name.
These modifiers can be combined as follows:
- "ep": causes OmniMark to access the system identifier obtained by searching for the entity's public identifier in the
library rules.
- "eo": causes OmniMark to access the system identifier declared for the notation associated with the entity. This combination can only be used in an
external-data-entity rule because external text entities have no notations.
- "eop": causes OmniMark to access the system identifier obtained by searching for the entity notation's public identifier in
library rules. This combination can only be used in an external-data-entity rule because external text entities have no notations.
If an entity has no system identifier, then the "e" format modifier acts the way "ep" does.
If an entity has no public identifier, or if the program has no library rule to associate a system identifier with the entity's public identifier, then it is an error to use the "ep" format modifier combination. If such an entity also does not declare a system identifier in the entity declaration, then it is also an error to use the "e" format modifier.
The same observation applies to the system identifier of the entity's notation when using the above format modifiers in combination with the "o" format modifier.
All of the combinations above may be further combined with the "l" or "u" format modifiers. Additionally, the "o" format modifier can also be combined with the "f" and "k" format modifiers, provided that it is not also combined with the "e" or "p" modifiers.
The "f" and "k" format modifiers can only be used with entity names and notation names.
|