This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
substring function not handling hyphens in variables correctly
- To: XSL-List at lists dot mulberrytech dot com
- Subject: [xsl] substring function not handling hyphens in variables correctly
- From: Chas Mick <cmick at asset dot com>
- Date: Thu, 13 Sep 2001 11:36:46 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
I have just upgraded from Xalan 1.0.0 to Xalan
1.3. The following snippets no longer function
correctly:
<xsl:value-of
select="concat(substring($user,1,3),substring($user,5,6),substring($user,8,11))"/>
The 'user' variable has the form '111-22-3333',
i.e., a social security number. I want the result
after this function call to be simply an integer
(i.e., 111223333).
This worked fine in Xalan 1.0.0. No longer
operates correctly with Xalan 1.3. My new output
is: '11122-3333333'. I've narrowed it down to the
substring function is not correctly handling
hypens in variables.
For example, if the user variable is
'111-22-3333', and the following is evaluated:
<xsl:value-of select="substring($user,5,6)" />
I should get the middle '22' (right?), but instead
I get '22-333'.
Any suggestions?
Thanks,
Chas
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list