Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - translate function trims zeros on '1.00' and gives a simple '1' ? >Thread Next - Re: translate function trims zeros on '1.00' and gives a simple '1 Re: translate function trims zeros on '1.00' and gives a simple '1' ?To: NULL Date: 1/3/2009 12:03:00 AM On Fri, 2 Jan 2009 14:49:01 -0800, Savvoulidis Iordanis
<SavvoulidisIordanis@d...> wrote:
>I'm creating a CSV (text) file out of a XML file. I'm using the following
>expression so that when the XYZ field contains a value of let's say 3,54 it
>must be converted to 3.54. And also if it contains (-) I want to replace it
>with the value of 1.00
>While the 1st one works, when the field contains (-) I get a simple 1 and
>not 1.00 in the output file. Why?
>
><xsl:value-of select="translate(translate(XYZ,',','.'),'-','1.00')
translate() function translates a list of (individual) characters to
other characters. It does not translate complete strings to other
strings.
So translate('A nice car', 'Aca', '123') would create an output string
translation like this :
A nice car -> becomes :
1 ni2e 23r
HTH
Cheers - Neil
------------------------------------------------
Digital Media MVP : 2004-2009
http://mvp.support.microsoft.com/mvpfaqs
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
