|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Removing leading zeros from String like 000747-918
Thanks for the suggestion. I was able to solve the problem by creating a new template and calling from a variable like
<xsl:variable name="a">
<xsl:call-template name="removeLeadingZeros">
<xsl:with-param name="phone">
<xsl:value-of select="EVENT/ContactPhone"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:template name="removeLeadingZeros">
<xsl:param name="phone"/>
<xsl:message>
<xsl:value-of select="$phone"/>
</xsl:message>
<xsl:choose>
<xsl:when test="starts-with($phone,'0')">
<xsl:call-template name="removeLeadingZeros">
<xsl:with-param name="phone">
<xsl:value-of select="substring-after($phone,'0' )"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$phone"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Thanks for spending time...
Thanks
Kotes
-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Norma Yeazell
Sent: Tuesday, March 16, 2004 2:32 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: Removing leading zeros from String like 000747-918-1212
Here is the clue I got earlier this week
Have a look at format-number(), you will need something like:
<xsl:value-of select="format-number(.,0)"/>
-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Kotes Mogili
Sent: Tuesday, March 16, 2004 2:18 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Removing leading zeros from String like 000747-918-1212
Hi,
I am trying to remove leading zeros from a String like "000747-918-1212"
. Please let me know if there is any function available in XSL to do
this.
Thanks for your time
Thanks
kotes
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Confidentiality Notice
The information contained in this e-mail is confidential and intended for use only by the person(s) or organization listed in the address. If you have received this communication in error, please contact the sender at O'Neil & Associates, Inc., immediately. Any copying, dissemination, or distribution of this communication, other than by the intended recipient, is strictly prohibited.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








