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

Re: Formatting a String

Subject: Re: Formatting a String
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Mon, 17 Jun 2002 16:07:10 +0000
java substring format phone number
I was
able to get this format with param's and substring functions, but its pretty
ugly.
Did you try substring like below?
<xsl:variable name="phone" select="/PhoneNum/text()"/>
<xsl:value-of select="concat('(',substring($phone,1,4),') ',substring($phone,5,3),'-',substring($phone,8,4))"/>
If you have tried this and u find this an Ugly approach, then u might want to use the extension functions ( Java methods that return you the result in your required format).
HTH
Vasu
From: "CROFT, MICHAEL" <MCROFT@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:  Formatting a String
Date: Mon, 17 Jun 2002 10:36:24 -0400

Is there a slick way to format a string? For example:

Turn this: 5085551234 Into this: (508) 555-1234

This isnt a true number, so I dont think number functions will do it. I was
able to get this format with param's and substring functions, but its pretty
ugly.


Mike



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender and postmaster@xxxxxxxxxx
**********************************************************************



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




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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.