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

Implements unicode escaping similar to JSONObject.

* Removes deprecation on XML.stringToValue(). It now provides unescaping for strings to convert XML entities back into values.
* New unescape function to handle XML entities -> value conversion.
This commit is contained in:
John J. Aylward 2016-09-22 12:38:06 -04:00
parent c24be0e4ea
commit a2d3b59394
2 changed files with 73 additions and 11 deletions

View file

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