如果传入的变量值包含脚本符号,会使格式错乱
//格式化名称,防止xml出错
private String formatName(String name) {
name = name.replace("&", "&");
name = name.replace(">", ">");
name = name.replace("<", "<");
name = name.replace("\"", """);
name = name.replace("'", " '");
return name;
}