Merge pull request #1234 from CherryRum/v5-dev

修改使用xml.setXmlStandalone(true)设定属性后,父节点格式化位置不对。
This commit is contained in:
Golden Looly 2020-11-20 16:36:46 +08:00 committed by GitHub
commit 281341ebd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -587,6 +587,7 @@ public class XmlUtil {
final Transformer xformer = factory.newTransformer();
if (indent > 0) {
xformer.setOutputProperty(OutputKeys.INDENT, "yes");
xformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, "yes");
xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", String.valueOf(indent));
}
if (StrUtil.isNotBlank(charset)) {