Re: [xsl] replace() and translate() second try

Subject: Re: [xsl] replace() and translate() second try
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 03 Jun 2011 08:05:08 +0100
On 03/06/2011 07:00, Kenneth Reid Beesley wrote:
I see that my previous message got rather garbled.  Here's a simplified version of the question.
Assume we have an XSLT transform with something like

translate(string, 'abcd', 'ABCD')

Obviously 'a' gets replaced with 'A', 'b' with 'B', etc.

Should this still work if the 'abcd' is replace by a string of 4  Unicode _supplementary_ characters?
That is, does translate() work with Characters (including supplementary characters) or just chars?


Yes, it should work correctly, and I have tests to show that it does, so please raise a bug report with a reproducible test case.


The replace() function should also work with all Unicode characters, though there may be question marks here about which version of Unicode the characters are defined in, especially if you are trying to match them against Unicode character categories such as \p{Ll}.

Michael Kay
Saxonica

Current Thread