- 3.6. Function reference
3.6.13. entity() - 3.6.12. date()
« Previous - 3.6.14. firstof()
Next »
3.6.13. entity()
| Reference | string entity(string) |
|---|
Allows to display an entity in the output document.
Because OPT contains an XML parser, all the entities are parsed on the server-side. Usually, this is not a bad thing, because the entities have been introduced mostly for the user convenience and the web browser is able to handle both the entities and the original characters. However, in certain situations it may be necessary to send the entity in the browser. We cannot prevent the parser from processing it, so we may use this function to encode it:
<p>An example of &Acute; entity: {u:entity('Acute')}</p>
The result would be:
<p>An example of &Acute; entity: &Acute;</p>
In order to work, this function must not be escaped. The best way to achieve this is to prepend the expression with
u:modifier.
The function recognizes any valid XML entity name (excluding Unicode symbols), for example Acute, #184 and #xB8. If the function is not able to parse the entity name, it generates an exception which is captured by the script.
See also:
- 3.6.13. entity()
3.6. Function reference - « Previous
3.6.12. date() - Next »
3.6.14. firstof()