This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

substring function not handling hyphens in variables correctly


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]