public static String normalize(char[] chars,int start,int length){
  StringBuffer buff=new StringBuffer();
  for (int i=start; i < start + length; i++) {
    char c=chars[i];
switch (c) {
case '\'':
      buff.append("&apos;");
    break;
case '"':
  buff.append("&quot;");
break;
case '&':
buff.append("&amp;");
break;
case '<':
buff.append("&lt;");
break;
case '>':
buff.append("&gt;");
break;
default :
buff.append("" + c);
break;
}
}
return buff.toString();
}

public static String normalize ( char [ ] chars , int start , int length ) { StringBuffer buff = new StringBuffer ( ) ; for ( int i = start ; i < start + length ; i ++ ) { char c = chars [ i ] ; switch ( c ) { case '\'' : buff . append ( "&apos;" ) ; break ; case '"' : buff . append ( "&quot;" ) ; break ; case '&' : buff . append ( "&amp;" ) ; break ; case '<' : buff . append ( "&lt;" ) ; break ; case '>' : buff . append ( "&gt;" ) ; break ; default : buff . append ( "" + c ) ; break ; } } return buff . toString ( ) ; }
description of the method
