mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-06 10:45:23 +08:00
Passed simple test
This commit is contained in:
@@ -413,14 +413,26 @@ public class XML {
|
|||||||
} else if (token == LT) {
|
} else if (token == LT) {
|
||||||
// Nested element
|
// Nested element
|
||||||
if (parse(x, jsonObject, tagName, config)) {
|
if (parse(x, jsonObject, tagName, config)) {
|
||||||
if (jsonObject.length() == 0) {
|
if (config.getForceList().contains(tagName)) {
|
||||||
context.accumulate(tagName, "");
|
if (jsonObject.length() == 0) {
|
||||||
} else if (jsonObject.length() == 1
|
context.append(tagName, "");
|
||||||
&& jsonObject.opt(config.getcDataTagName()) != null) {
|
} else if (jsonObject.length() == 1
|
||||||
context.accumulate(tagName, jsonObject.opt(config.getcDataTagName()));
|
&& jsonObject.opt(config.getcDataTagName()) != null) {
|
||||||
|
context.append(tagName, jsonObject.opt(config.getcDataTagName()));
|
||||||
|
} else {
|
||||||
|
context.append(tagName, jsonObject);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
context.accumulate(tagName, jsonObject);
|
if (jsonObject.length() == 0) {
|
||||||
|
context.accumulate(tagName, "");
|
||||||
|
} else if (jsonObject.length() == 1
|
||||||
|
&& jsonObject.opt(config.getcDataTagName()) != null) {
|
||||||
|
context.accumulate(tagName, jsonObject.opt(config.getcDataTagName()));
|
||||||
|
} else {
|
||||||
|
context.accumulate(tagName, jsonObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user