buf.append("&amp;");
buf.append("&");
    private String escapeAttr(String base) {	final int len = base.length() - 1;	final String str = "&quot;";	int pos;	char[] ch = base.toCharArray();	StringBuffer buf = new StringBuffer();        for(int i=0; i<base.length(); i++){	    if (ch[i] > '\u007F') {	        buf.append('%');		buf.append(Integer.toHexString((int)ch[i]));	    }	    else {		// These chars are reserved or unsafe in URLs		// pg 196, 'HTML, The Definitive Guide" C. Musciano, et. al	        switch (ch[i]) {		    case '\u007F' :		    case '\u0022' :		    case '\u007B' :		    case '\u007D' :		    case '\u007C' :		    case '\\'     :		    case '\t'     :		    case '\u005E' :		    case '\u007E' :		    case '\u005B' :		    case '\u005D' :		    case '\u0060' :		        buf.append('%');		        buf.append(Integer.toHexString((int)ch[i]));		        break;		    case '\u0026' :			buf.append("&amp;");			break;		    default:			        buf.append(ch[i]); break;	        }	    }   	}	base = buf.toString();	while ((pos = base.indexOf('"')) > -1) {	    if (pos == 0) {		final String after = base.substring(1);		base = str + after;	    }	    else if (pos == len) {		final String before = base.substring(0, pos);		base = before + str;	    }	    else {		final String before = base.substring(0, pos);		final String after = base.substring(pos+1);		base = before + str + after;	    }	}	return base;    }