Commit 0b1ac3e9 authored by Thomas B. Rücker's avatar Thomas B. Rücker 😊
Browse files

Essential part of upstream pull req No. 20

 Some numeric values would not get formatted to valid JSON. This
 incorporates the suggestions from issue #15.

Also fixed whitespace of original patch.
Additional fix for related issue will follow.
parent 3d2ab9ae
......@@ -125,8 +125,22 @@
<!-- number (no support for javascript mantissa) -->
<xsl:template match="text()[not(string(number())='NaN' or
(starts-with(.,'0' ) and . != '0'))]">
<xsl:value-of select="."/>
(starts-with(.,'0' ) and . != '0' and not(starts-with(.,'0.' ))) or
(starts-with(.,'-0' ) and . != '-0' and not(starts-with(.,'-0.' ))))]">
<xsl:when test="starts-with(.,'.')">
<xsl:value-of select="concat('0',.)"/>
<xsl:when test="starts-with(.,'-.')">
<xsl:value-of select="concat('-0.', substring(.,3))"/>
<xsl:when test="substring(., string-length(.))='.'">
<xsl:value-of select="concat(.,0)"/>
<xsl:value-of select="."/>
<!-- boolean, case-insensitive -->
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment