The use-character-maps
parameter is a list of characters
and corresponding string substitutions.
Character maps allow a specific character appearing in a text or attribute node or a string in the instance of the data model to be replaced with a specified string of characters during serialization. The string that is substituted is output "as is," and the serializer performs no checks that the resulting document is well-formed. This mechanism can therefore be used to introduce arbitrary markup in the serialized output. See Section 26.1 Character Maps XT30 of [XSL Transformations (XSLT) Version 3.0] for examples of using character mapping in XSLT.
Character mapping is applied to the characters that actually appear in a text or attribute node or a string in the instance of the data model, before any other serialization operations such as escaping or Unicode Normalization are applied. If a character is mapped, then it is not subjected to XML or HTML escaping, nor to Unicode Normalization. The string that is substituted for a character is not validated or processed in any way by the serializer, except for translation into the target encoding. In particular, it is not subjected to XML or HTML escaping, it is not subjected to Unicode Normalization, and it is not subjected to further character mapping.
Character mapping is not applied to characters in text nodes whose
parent elements are listed in the cdata-section-elements
parameter,
nor to characters for which output escaping has
been disabled (disabling output escaping is an [XSL Transformations (XSLT) Version 3.0]
feature),
nor to characters in attribute
values that are subject to URI escaping defined for the HTML and
XHTML output methods, unless URI escaping has been disabled using the
escape-uri-attributes
parameter in the output
definition.
On serialization, occurrences of a character specified in the
use-character-maps
in text nodes,
attribute values
and strings
are replaced by the corresponding string from the use-character-maps
parameter.
Note:
Using a character map can result in non-well-formed documents if the string contains XML-significant characters. For example, it is possible to create documents containing unmatched start and end tags, references to entities that are not declared, or attributes that contain tags or unescaped quotation marks.
If a character is mapped, then it is not subjected to XML or HTML escaping.
A serialization error [err:SERE0008] occurs if character mapping causes the output of a string containing a character that cannot be represented in the encoding that the serializer is using for output. The serializer MUST signal the error.