From 56bbc0d12cbead128919031e26ea661e8c0b8874 Mon Sep 17 00:00:00 2001 From: "Thomas B. Ruecker" Date: Sat, 16 May 2015 17:30:34 +0000 Subject: [PATCH] Fix issue with only "-" and whitespace in element Fixes: #2198 If there is a single "-" or it is only accompanied by whitespace, then it wouldn't get escaped as it was detected as as a number. This would produce invalid JSON. This makes the numbers part ignore such and thus ensures it gets escaped as text. There might be other corner cases related to number parsing, this should be investigated. --- web/xml2json.xslt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/xml2json.xslt b/web/xml2json.xslt index 618bd2fa..bc7d7d8c 100644 --- a/web/xml2json.xslt +++ b/web/xml2json.xslt @@ -126,7 +126,8 @@ + (starts-with(.,'-0' ) and . != '-0' and not(starts-with(.,'-0.' )))) and + not(substring(normalize-space(.), string-length(normalize-space(.))) = '-')]">