We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8797cb3 commit 9570de5Copy full SHA for 9570de5
gen/src/main/java/com/gitee/gen/util/FormatUtil.java
@@ -1,6 +1,7 @@
1
package com.gitee.gen.util;
2
3
import org.dom4j.Document;
4
+import org.dom4j.DocumentHelper;
5
import org.dom4j.io.OutputFormat;
6
import org.dom4j.io.SAXReader;
7
import org.dom4j.io.XMLWriter;
@@ -26,6 +27,7 @@ public static String formatXml(String input) {
26
27
// 注释:创建输出格式
28
OutputFormat formater = OutputFormat.createPrettyPrint();
29
// formater=OutputFormat.createCompactFormat();
30
+ // format.setSuppressDeclaration(true);//去掉顶部的<?xml version="1.0" encoding="utf-8"?>
31
// 注释:设置xml的输出编码
32
formater.setEncoding("utf-8");
33
// TAB缩进
@@ -45,6 +47,4 @@ public static String formatXml(String input) {
45
47
return input;
46
48
}
49
-
50
0 commit comments