Re: [xsl] Question on translate() function

Subject: Re: [xsl] Question on translate() function
From: "Mailing Lists Mail daktapaal@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Sep 2017 09:19:51 -0000
>>It's valid, but it does something
>>completely different from what the
>>user probably intended.
What does it do ?


On Sep 26, 2017 4:32 AM, "Michael Kay mike@xxxxxxxxxxxx" <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:


> I have seen expressions like :
> translate($xxx, 'ABCDE','x');
> which is to say, replace ABCDE with x .. this also works fine
> is this not valid?

I have seen expressions like this too. It's up there in the list of common
XPath coding mistakes. It's valid, but it does something completely
different from what the user probably intended. One of those mistakes you
make if you guess what a function does from its name, without actually
reading the spec.

Michael Kay
Saxonica

Current Thread