I am transforming a xml into json using xml-to-json() function of xslt 3.0 using Saxon 9.8 HE. The problem I am getting is that my Number value is getting converted into exponent (scientific notation). I want output same what i pass in input xml.
xsltfiddle link https://xsltfiddle.liberty-development.net/94hvTyT
input xml
<?xml version="1.0" encoding="UTF-8"?>
<map xmlns="http://www.w3.org/2005/xpath-functions">
<map key="Request">
<number key="price">1234567</number>
</map>
</map>
Note that this xml is also genrated using json-to-xml() funtion of xslt 3.0
XSLT
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:value-of select="xml-to-json(., map { 'indent' : true() })"/>
</xsl:template>
</xsl:stylesheet>
OUTPUT
{ "Request" :
{ "price" : 1.234567E6 }
}
Desired Output
{ "Request" :
{ "price" : 1234567 }
}
Any solution/suggestions on it would be great help for me.