Explorar el Código

xml转map有序修改

rengb hace 5 años
padre
commit
14b30bb9a8
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      trans/src/main/java/com/lantone/qc/trans/comsis/XmlUtil.java

+ 1 - 0
trans/src/main/java/com/lantone/qc/trans/comsis/XmlUtil.java

@@ -24,6 +24,7 @@ public class XmlUtil {
      * @return
      */
     public static String xmlErrorCorrection(String xml) {
+        xml = xml.replaceAll("\\<\\?xml[\\S\\s][^<>]*\\?\\>", "");
         StringBuffer sbf = new StringBuffer();
         Pattern pattern = Pattern.compile("\\<.[^<>]*\\>");
         Matcher matcher = pattern.matcher(xml);