From 0ee1eb427465fd1b29411a37f3485a8bbbcb5401 Mon Sep 17 00:00:00 2001 From: xiaoxie Date: Wed, 20 Apr 2022 13:56:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=95=E5=83=8F=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=9A=E5=AE=9E=E6=B5=8B=E9=83=A8=E5=88=86=E5=8E=82?= =?UTF-8?q?=E5=AE=B6=EF=BC=88TP-Link=20IPC43AW=EF=BC=89=E5=BD=95=E5=83=8F?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=9A=84xml=E6=8A=A5=E6=96=87=E6=95=B0=E6=8D=AE=E4=B8=AD?= =?UTF-8?q?=E6=9C=89=E5=A4=9A=E4=BD=99=E7=9A=84=E7=A9=BA=E6=A0=BC=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E8=A7=A3=E6=9E=90String=E4=B8=BAInteger?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=EF=BC=8C=E5=A2=9E=E5=8A=A0trim=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=BF=99=E4=B8=AA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/gb28181/utils/XmlUtil.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java index ba6eed5f..09e7a04f 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java @@ -20,8 +20,8 @@ import java.util.*; /** * 基于dom4j的工具包 - * - * + * + * */ public class XmlUtil { /** @@ -31,9 +31,9 @@ public class XmlUtil { /** * 解析XML为Document对象 - * + * * @param xml 被解析的XMl - * + * * @return Document */ public static Element parseXml(String xml) { @@ -51,7 +51,7 @@ public class XmlUtil { /** * 获取element对象的text的值 - * + * * @param em 节点的对象 * @param tag 节点的tag * @return 节点 @@ -62,12 +62,12 @@ public class XmlUtil { } Element e = em.element(tag); // - return null == e ? null : e.getText(); + return null == e ? null : e.getText().trim(); } /** * 递归解析xml节点,适用于 多节点数据 - * + * * @param node node * @param nodeName nodeName * @return List> @@ -106,7 +106,7 @@ public class XmlUtil { /** * xml转json - * + * * @param element * @param json */