[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Question on translate() function

Subject: Re: Question on translate() function
From: "Mailing Lists Mail daktapaal@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Sep 2017 10:40:35 -0000
Re:  Question on translate() function
Oh . That makes sense then.. The only place that expression is valid is
when I have something like
translate('ABCDE','')
That replaces a b c d e f to '' ..so in effect it only changes the a and
deletes b c d e so it looks like it is changing ABCDE into space but in
fact it is only changing A and deletes the rest

Thanks ..

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

>
> On 26 Sep 2017, at 10:20, Mailing Lists Mail daktapaal@xxxxxxxxx <
> xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> >>It's valid, but it does something
> >>completely different from what the
> >>user probably intended.
> What does it do ?
>
>
> It replaces every occurrence of "A" by "x", deletes all occurrences of B,
> C, D, and E, and leaves all other characters unchanged.
>
> Michael Kay
> Saxonica
>
>
>
> 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
>
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://-list/293509> (by email)
>
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <-list/1311928> (by
> email <>)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.