1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

properly unescape tokens in JSONML for reversability.

This commit is contained in:
John J. Aylward 2016-09-22 16:23:09 -04:00
parent f58a0f4684
commit adb0478f66

View file

@ -175,7 +175,7 @@ public class JSONML {
if (!(token instanceof String)) { if (!(token instanceof String)) {
throw x.syntaxError("Missing value"); throw x.syntaxError("Missing value");
} }
newjo.accumulate(attribute, keepStrings ? token :XML.stringToValue((String)token)); newjo.accumulate(attribute, keepStrings ? XML.unescape((String)token) :XML.stringToValue((String)token));
token = null; token = null;
} else { } else {
newjo.accumulate(attribute, ""); newjo.accumulate(attribute, "");
@ -226,7 +226,7 @@ public class JSONML {
} else { } else {
if (ja != null) { if (ja != null) {
ja.put(token instanceof String ja.put(token instanceof String
? keepStrings ? token :XML.stringToValue((String)token) ? keepStrings ? XML.unescape((String)token) :XML.stringToValue((String)token)
: token); : token);
} }
} }