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

RE: replacing , with a .

Subject: RE: replacing , with a .
From: Mohd Shadab <mshadab@xxxxxxxxxxxxxx>
Date: Fri, 18 Jul 2003 16:54:36 +0100
replacing with
This should be of some help if not translate(string,",",".")


<xsl:param name="replace" select=","/>
<xsl:param name="with" select="."/>

<xsl:template name="do-replace">
 <xsl:param name="text"/>
 <xsl:choose>
  <xsl:when test="contains($text, $replace)">
   <xsl:value-of select="substring-before($text, $replace)"/>
   <xsl:value-of select="$with"/>
   <xsl:call-template name="do-replace">
    <xsl:with-param name="text" select="substring-after($text, $replace)"/>
   </xsl:call-template>
  </xsl:when>
  <xsl:otherwise>
   <xsl:value-of select="$text"/>
  </xsl:otherwise>
 </xsl:choose>
</xsl:template>


Regards,

Shadab

Developer

Address: 4 Buckingham Gate, London SW1E 6JP 
Tel: +44 (0)20 7802 4643 fax: +44 (0)20 7802 
email: mshadab@xxxxxxxxxxxxxx

do something lastminute.com

-----Original Message-----
From: Challa, Harsha [mailto:hchalla@xxxxxxxxxxxx]
Sent: 18 July 2003 16:36
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject:  replacing , with a .


XML Gurus,

I have a street field with comma's  in the field. I would like to replace
the 
commas with a . when i am extracting the data using XSL and writing the flat
file.

I am doing 

 <xsl:value-of
select="ShippingPointAddress/@ShippingPointStreet"></xsl:value-of> 

to write to the flat file.

Could some one let me know if there is a function to do this? 
To replace all the commas with . in the field  and how to use it.

thanks in advance 
Harsha 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.