Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2012-12-27T17:58:57Z by SystemAdmin
SystemAdmin
SystemAdmin
6184 Posts
ACCEPTED ANSWER

Pinned topic Decimal value formatting in XML outputs?

‏2012-12-10T20:18:54Z |
In an 8.4.0.3 WTX map running on Windows 7 SP1 that uses the same XML schema for input and output, all decimal type values are being stripped of leading and trailing zeroes. Thus "0.40" in the input becomes ".4" in the output. "2500.00" is output as "2500". Is this expected behavior? It's certainly not what I expect.
Updated on 2012-12-27T17:58:57Z at 2012-12-27T17:58:57Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    6184 Posts
    ACCEPTED ANSWER

    Re: Decimal value formatting in XML outputs?

    ‏2012-12-27T17:58:57Z  in response to SystemAdmin
    The response from IBM Support:

    "In working with our developer on your test case, we are finding that when using native schema there does not appear to be a way of preserving trailing zeros. Internally WTX truncates trailing zeros when ever the internal format is a number. XML schema pattern will not work on output. WTX does not use schema information on output.

    The following are workarounds that can be taken:
    1. Copy the schema and change the schema to have that output field defined as Text.

    Use the new schema in output and the following rule.
    (FROMNUMBER(price:sequence:item:sequence:shiporder:global:In1, "{####'.'2##2}")

    2. If the schema was altered to have a main group, it would be possible to use a Xerces type tree. The Xerces type trees can be edited and output format can be entered that will enable preserving trailing spaces.

    Note: Xerces type tree requires a main global document group or groups. (See ipo.xsd in WTX examples)

    Given the limitation of the product, we hope you can take advantage of the above workarounds."

    http://Test case attached. JJD