Subject: RE: [xsl] substring function From: Américo Albuquerque <aalbuquerque@xxxxxxxxxxxxxxxx> Date: Fri, 12 Jul 2002 11:57:25 +0100 |
Hi Michael I've tested your exemples and they worked as was suposed to. Maby if you show us the xml and the xsl we might help you. As Agnes point out, the first exemple show this result: (123)456-7890333 because you concat the string after the 'x', but in the result you show, it ignore the string after the 'x'. maby your template isn't working on that particular node and that result cames from another that doesn't have an extension (an 'x333'). -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of CROFT, MICHAEL Sent: Thursday, July 11, 2002 6:37 PM To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx' Subject: RE: [xsl] substring function That is interesting, Im not getting those results. I will research deeper. Thanks for your effort. Mike -----Original Message----- From: Agnes Kielen [mailto:a.kielen@xxxxxxx] Sent: Thursday, July 11, 2002 1:25 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] substring function Hi Michael, I don't get it. When I try your first 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> I get this: (123)456-7890333 You don't get an 'x' because you ask for the characters after the 'x'. So I changed it into: <xsl:if test="string(WorkPhoneNumber)"> <xsl:value-of select="concat('(',substring(WorkPhoneNumber,1,3),')',substring(WorkPhoneNum ber,4,3),'-',substring(WorkPhoneNumber,7,4),'x',substring-after(WorkPhoneNum ber, 'x'))"/> </xsl:if> and got with this input: <WorkPhoneNumber>1234567890x333</WorkPhoneNumber> the following result: (123)456-7890x333 I didn't check your second try. Hopes this helps, but not sure. Agnes XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list ********************************************************************** 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 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] substring function, CROFT, MICHAEL | Thread | [xsl] node vrs node//node?, Michael |
RE: [xsl] displaying xml file style, Ben Fry | Date | [xsl] XSLT to find missing characte, Kirk Allen Evans |
Month |