[MarkLogic Dev General] JSON transformation problem

Roy Chowdhury, Soumadri SRRoyChowdhury at INNODATA.COM
Tue Jan 12 04:34:21 PST 2016


I am trying to transform the below mentioned XML data into JSON:

When I am executing it against a database which does not have the respective schema associated I am getting the following output:
{"data":{"price1":"10.23", "price2":"10.00"}}

When I am executing it against a database with proper schema associated, it returns the following:
{"data":{"price1":10.23, "price2":10}}

Note that the second one treated the values as integer. This is not happening when the data is returned in XML format.

Why the function is behaving differently in the above two cases and is there a way to retain two decimal places after dot(.) even when the schema is associated?

Soumadri Roy

"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20160112/c492c07f/attachment.html 

More information about the General mailing list