1.xml 字符串处理
public static String htmlEncode(int i){
if (i=='&') return "&";
else if (i=='<') return "<";
else if (i=='>') return ">";
else if (i=='"') return """;
else if (i == ' ') return " ";
else if (i == ' ') return " ";
else return ""+(char)i;
}
/**
* 处理xml文件特殊字符
* @param st
* @return
*/
public static String htmlEncode(String st){
StringBuilder buf = new StringBuilder();
for (int i = 0;i<st.length();i++){
buf.append(htmlEncode(st.charAt(i)));
}
return buf.toString();
}
不断补充中....