IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Numeric Conversion Options · View
jshein
Posted: Tuesday, September 17, 2019 1:02:42 PM
Rank: Newbie

Joined: 9/17/2019
Posts: 2
Location: Atlanta
I'm doing a simple mapping from one field defined as a nonNegativeInteger to a destination field defined as a nonNegativeInteger.

If the source field is more than 6 digits, I end up with a exponent value i.e. 2.900115272898E12 instead of 2900115272898. If I store the result field as a string, I don't see the issue. Unfortunately, I can't modify the datatypes in the destination schema.

The generated XSLT is:
<xsl:value-of select="number(*[local-name()='FOO' and namespace-uri()=''])"/>

the source field is
<FOO>2900115272898</FOO>
defined as:
<xs:element name="FOO" type="xs:nonNegativeInteger"/>

the result is:
<FOO1>2.900115272898E12</FOO1>
defined as:
<xs:element name="FOO1">
<xs:simpleType>
<xs:restriction base="xs:nonNegativeInteger">
<xs:maxInclusive value="999999999999999999999999"/>
</xs:restriction>
</xs:simpleType>
</xs:element>

I'm looking for
<FOO1>2900115272898</FOO1>

Any suggestions on how I can force the conversion?

thanks!
Jeff
K101
Posted: Wednesday, September 18, 2019 11:11:34 AM
Rank: Advanced Member

Joined: 2/27/2009
Posts: 565
Make sure you work with any code target language other than XSLT 1.0 (so, XSLT 2.0, XQuery, Java, C#, C++, or BUILTIN).
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.