coding in xslt - adding two values together, but only using the first 8 characters of the value

I am creating a hash off of account numbers.   using xslt, can someone help code the following?

the two account numbers i need added up are

the value the following code produces is 316,294,254

this is the value of the two account numbers if you take in the full 9 digit account number and use it in the summing equation.
i need for the xlst code to take the two account numbers and only add the first 8 digits of the accountnumber together together.
12345678 and 19283746 which would equal 31,629,424

the xlst code i currently have in place is

<xsl:variable name="ENTRYHASH">
        <xsl:call-template name="prepend-pad">
          <xsl:with-param name="padVar" select = "number(sum( /ACCOUNT/ACCOUNTNUMBER ))"/>
Who is Participating?
Geert BormansInformation ArchitectCommented:
sum() only works on nodes
so you need to sum in a hardcoded fashion
number(substring((/ACCOUNT/ACCOUNTNUMBER)[1] , 1, 8) + substring((/ACCOUNT/ACCOUNTNUMBER)[2] , 1, 8) )
that will do in XSLT1

If you need to do that on more than two,  you will need a recursive template
jamesmetcalf74Author Commented:
Thanks Geert!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.