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

RE: format-number() for a phone number?

Subject: RE: format-number() for a phone number?
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Thu, 27 May 1999 10:54:03 -0600
xsl format phone number
David Carlisle wrote:
> you can do it within XSLT. the following inserts -
> into strings of digits, you should be able
> to modify it easily enough to insert () as well.
> 
> [...]
>     <xsl:when test="starts-with($left,'0')">
>       <xsl:text>0</xsl:text>
>       <xsl:call-template name="ssn-dash">
>         <xsl:param name="count" expr="$count+1"/>
>         <xsl:param name="left" expr="substring-after($left,'0')"/>
>       </xsl:call-template>
> [...]

Whee! Thanks, David.

Well since format-number() isn't behaving as expected in XT (any comments on
that?), I tried this method. Ugly as it is, it works, and I was able to
further modify it to be a general-purpose position-based substring function,
which is inefficient but works as long as the string is all digits.
Fortunately(?) for me, after spending half the day banging away on it, it
was decided to just change the source data so I don't have to deal with
splitting up 10-digit numbers at all. Heh.

Anyone who is interested can find get_digit_substring.xsl
at http://www.hyperreal.org/~mike/pub/xsl/

-Mike


 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.