67,513
社区成员
发帖
与我相关
我的任务
分享
if (StringUtils.isNotEmpty(raceXmlContext)) {
contextnew = ContentUtils.xmlReplace(raceXmlContext);
TX tx2 = null;
boolean condition = true;
while(condition) {
try {
tx2 = (TX)XmlUtil.fromXML(contextnew);
condition = false;
} catch (Exception var17) {
String sw = ContentUtils.getStackTraceInfo(var17);
String str = sw.toString();
if (str.indexOf("元素内容必须由格式正确的字符数据或标记组成") > 0) {
condition = false;
contextnew = contextnew.replaceAll("<>", "()");
tx2 = (TX)XmlUtil.fromXML(contextnew);
}
if (str.indexOf("元素类型 \"") > 0 && str.indexOf("\" 必须由匹配的结束标记 ") > 0) {
String s = str.substring(str.indexOf("元素类型 \"") + 6, str.indexOf("\" 必须由匹配的结束标记 "));
contextnew = contextnew.replaceAll("<" + s + ">", "(" + s + ")");
} else {
condition = false;
}
try {
tx2 = (TX)XmlUtil.fromXML(contextnew);
condition = false;
} catch (Exception var16) {
}
}
}
log.info("\n>>>>>Socket返回数据美化:\n" + XmlUtil.textMessageToXml(tx2));
command.setObj(tx2);
command.setSuccess(true);
} else {
log.error(">>>>>Socket返回异常数据recexmlcontext:" + raceXmlContext);
log.error(">>>>>msg:" + msg);
command.setSuccess(false);
command.setMsg(msg);
}