mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-08 11:34:43 +08:00
#748 - close XML tag explicitly for empty tags with configuration.
This commit is contained in:
@@ -877,12 +877,25 @@ public class XML {
|
||||
}
|
||||
}
|
||||
} else if ("".equals(value)) {
|
||||
sb.append(indent(indent));
|
||||
sb.append('<');
|
||||
sb.append(key);
|
||||
sb.append("/>");
|
||||
if(indentFactor > 0){
|
||||
sb.append("\n");
|
||||
if (config.isCloseEmptyTag()){
|
||||
sb.append(indent(indent));
|
||||
sb.append('<');
|
||||
sb.append(key);
|
||||
sb.append(">");
|
||||
sb.append("</");
|
||||
sb.append(key);
|
||||
sb.append(">");
|
||||
if (indentFactor > 0) {
|
||||
sb.append("\n");
|
||||
}
|
||||
}else {
|
||||
sb.append(indent(indent));
|
||||
sb.append('<');
|
||||
sb.append(key);
|
||||
sb.append("/>");
|
||||
if (indentFactor > 0) {
|
||||
sb.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Emit a new tag <k>
|
||||
|
Reference in New Issue
Block a user