This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27616 - [XSLT30] character maps needs a string? [I18N-ISSUE-396]
Summary: [XSLT30] character maps needs a string? [I18N-ISSUE-396]
Status: CLOSED WONTFIX
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-15 22:25 UTC by Addison Phillips
Modified: 2015-10-29 09:50 UTC (History)
2 users (show)

See Also:


Attachments

Description Addison Phillips 2014-12-15 22:25:58 UTC
http://www.w3.org/TR/xslt-30/#character-maps

The 'character-maps' feature allows mapping a Unicode 'char' (which is defined in a way that means a Unicode codepoint) to a replacement string. This is good for most purposes, but it's not clear to me if grapheme cluster sequences might be useful here as well.

This is an I18N WG comment.
Comment 1 Jim Melton 2014-12-15 23:27:22 UTC
This bug applies equally well to the XPath and XQuery Functions and Operators 3.1 specification.
Comment 2 Michael Kay 2014-12-21 21:08:49 UTC
Personal response:

Character maps are a pretty ugly feature; they were introduced as a slightly cleaner alternative to the disable-output-escaping feature, but they still have the architectural disadvantage of creating an unwanted coupling between the transformation and the serialization of its results. We wouldn't want to encourage people to do semantic transformations of the data in the serialization phase, so I personally wouldn't welcome any feature-creep in this area.

The most common use cases for character maps is to generate entity or character references, or other serialization artefacts such as DOCTYPE declarations or CDATA sections that have no direct representation in the XDM data model. I haven't come across any users who have problems that would be solved by allowing substitution of anything more than a single character. Substituting arbitrary strings could become very expensive, and could lead to users attempting to use the feature for tasks that are properly done in the transformation phase.
Comment 3 Michael Kay 2015-01-22 18:52:02 UTC
The XSL WG agreed that we do not want to enhance the capability of character maps. There were designed as a way of working around limitations in the serializer such as the ability to generate DOCTYPE declarations, or for generating output in "not-quite-standard" formats such as PHP code; they meet this need; and we do not want to encourage people to use them as a general purpose string transformation language in its own right.

We are therefore respectfully declining this suggested enhancement.

XSL WG here is acting for the XQuery WG as well.