xsltxslt-1.0altovamap-force

XSLT text to large integer


I'm attempting to create an XSLT mapping that properly converts a fairly large integer value coming through in a text field into the appropriate integer value. The problem is that since 1.0 only supports converting to type number, I get a value like 1.234567890E9 back for input of "1234567890"

I'm using Altova MapForce with XSLT1.0 as the coding platform. XSLT2.0 doesn't appear to be an option, as the XSLT has to be processed using a pre-existing routine that only supports XSLT1.0

By default Mapforce generates <xsl:value-of select="string(floor(number(string(.))))"/> and I've tried every combination of functions I can think of, but always get a float for large values.

Further testing shows the problem lies in Mapforce, which insists on using the number() function when mapping from text to int.


Solution

  • The problem lies within Mapforce, so I've decided to let mapforce generate it's code, then overwrite it for this one field that's causing all the trouble.

    @Tobias @Michael Thanks to you both for your help. I've +1'ed both your answers and a few comments since your help led to the answer.