Here you can find the source of sanitizeAttribute(String value)
public static String sanitizeAttribute(String value)
//package com.java2s; // under the terms of the GNU Lesser General Public License as published public class Main { /** Map of strings that must be replaced inside html attributes and their replacements. (They * need to be applied in order so amps are not double escaped.) */ protected static final String[][] ATTR_ESCAPES = { { "&", "&" }, { "'", "'" }, { "\"", """ }, { "<", "<" }, { ">", ">" }, }; /**//from www. j a v a 2 s .co m * Nukes special attribute characters. Ideally this would not be needed, but some integrations * do not accept special characters in attributes. */ public static String sanitizeAttribute(String value) { for (int ii = 0; ii < ATTR_ESCAPES.length; ++ii) { value = value.replace(ATTR_ESCAPES[ii][0], ""); } return value; } }