Table of contentsAppendices |
9 Character MapsCharacter MapsThe Character maps allow a specific character appearing in a text or attribute node 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 [character-maps] of [XSLT2] for examples of using character mapping in XSLT. Character mapping is applied to the characters that actually appear in a text or attribute node 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. If the string cannot be represented using the target encoding, the serializer takes the same action as it would if the offending characters appeared directly in the instance of the data model. Character mapping is not applied to characters in text nodes whose
parent elements are listed in the On serialization, occurrences of a character specified in the
NOTE: delGCharacter mapping is applied to the characters that actually appear in a text or attribute node in the instance of the data model, before any other serialization operations such as escaping or Unicode normalization are applied. delGCharacter mapping is not applied to characters for which output
escaping has been disabled (disabling output escaping is an [XSLT2] feature),
nor to characters in text nodes whose parent
elements are listed in the If a character is mapped, then it is not subjected to XML or HTML escaping. A serialization error occurs if character mapping causes the output of a string containing a character that cannot be represented in the encoding that the processor serializer is using for output. The processor serializer MUSTSHOULD signal the error. |