[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] substring function
I am trying to format a phone number, which may contain an extension.... Here is the node: <WorkPhoneNumber>1234567890x333</WorkPhoneNumber> I am trying to get: (123) 456-7890 x333 In the output (html) here is my test: <xsl:if test="string(WorkPhoneNumber)"> <xsl:value-of select="concat('(',substring(WorkPhoneNumber,1,3),') ',substring(WorkPhoneNumber,4,3),'-',substring(WorkPhoneNumber,7,4),substrin g-after(WorkPhoneNumber, 'x'))"/> </xsl:if> This results in: (123) 456-7890 Ive also tried this... <xsl:if test="string(WorkPhoneNumber)"> <xsl:value-of select="concat('(',substring(WorkPhoneNumber,1,3),') ',substring(WorkPhoneNumber,4,3),'-',substring(WorkPhoneNumber,7,4),substrin g(WorkPhoneNumber, 10))"/> </xsl:if> which results in this: (123) 456-788909090909008080 Im not sure what is happening... 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
|
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
|