/** * Replaces in String str the characters &,>,<,",' * with their corresponding character entity codes. * @param str - the String where to replace * @return String */ protected String doEscapeXml(String str) { if(!isEmpty(str)){ str = str.replaceAll("&", "&"); str = str.replaceAll("<", "<"); str = str.replaceAll(">", ">"); str = str.replaceAll("\"", """); str = str.replaceAll("'", "'"); } return str; }
/** * Replaces in String str the characters &,>,<,",' * with their corresponding character entity codes. * @param str - the String where to replace * @return String */ protected String doEscapeXml(String str) { if(!isEmpty(str)){ str = str.replaceAll("&", "&"); str = str.replaceAll("<", "<"); str = str.replaceAll(">", ">"); str = str.replaceAll("\"", """); str = str.replaceAll("'", "'"); } return str; }