private static boolean checkAttributeCharacters(String chars) throws CharConversionException {
  boolean escape=false;
  for (int i=0; i < chars.length(); i++) {
    char ch=chars.charAt(i);
    if (ch <= 93) {
switch (ch) {
case 0x9:
case 0xA:
case 0xD:
        continue;
case '\'':
case '"':
case '<':
case '&':
      escape=true;
    continue;
default :
  if (ch < 0x20) {
    throw new CharConversionException("Invalid XML character &#" + ((int)ch) + ";.");
  }
}
}
}
return escape == false;
}

private static boolean checkAttributeCharacters ( String chars ) throws CharConversionException { boolean escape = false ; for ( int i = 0 ; i < chars . length ( ) ; i ++ ) { char ch = chars . charAt ( i ) ; if ( ch <= 93 ) { switch ( ch ) { case 0x9 : case 0xA : case 0xD : continue ; case '\'' : case '"' : case '<' : case '&' : escape = true ; continue ; default : if ( ch < 0x20 ) { throw new CharConversionException ( "Invalid XML character &#" + ( ( int ) ch ) + ";." ) ; } } } } return escape == false ; }
check if all passed characters match xml expression [ 2 ] .
