From ddd6003e42423038feef490c50ba5072fe2dc678 Mon Sep 17 00:00:00 2001 From: lin <1809040656@qq.com> Date: Thu, 19 Nov 2020 16:41:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=BF=E7=94=A8xml.setXmlS?= =?UTF-8?q?tandalone(true)=E8=AE=BE=E5=AE=9A=E5=B1=9E=E6=80=A7=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E7=88=B6=E8=8A=82=E7=82=B9=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E4=B8=8D=E5=AF=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java b/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java index eb0e34ea8..93739c56b 100644 --- a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java @@ -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)) {