Hello all, I'm expecting the answer to be no, but is it possible to influence the JSON serialization of <number> elements at all?
xml-to-json( <map xmlns="http://www.w3.org/2005/xpath-functions"> <number key="number">10111234</number> </map> )
Results in
{"number":1.0111234E7}
I read this in the spec, so it looks like the number is always being cast as a double:
xs:string(xs:double(fn:string($E)))
TIA, Constantine
________________________________
Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands.
Hi Constantine,
The XQuery specifications provide no means to influence the serialization of numeric values. We could think about adding an additional option for that in our own JSON module.
Cheers, Christian
On Fri, May 25, 2018 at 5:41 PM, Hondros, Constantine (ELS-AMS) C.Hondros@elsevier.com wrote:
Hello all,
I’m expecting the answer to be no, but is it possible to influence the JSON serialization of <number> elements at all?
xml-to-json(
<map xmlns="http://www.w3.org/2005/xpath-functions"> <number key="number">10111234</number> </map> )
Results in
{"number":1.0111234E7}
I read this in the spec, so it looks like the number is always being cast as a double:
xs:string(xs:double(fn:string($E)))
TIA, Constantine
basex-talk@mailman.uni-konstanz.de