private static boolean isName(String s){
  int n=s.length();
  if (n == 0) {
    return false;
  }
  if (!NAME_START_CHARS.contains(s.codePointAt(0))) {
    return false;
  }
  for (int i=1; i < n; ++i) {
    if (!NAME_CHARS.contains(s.charAt(i))) {
      return false;
    }
  }
  return true;
}

private static boolean isName ( String s ) { int n = s . length ( ) ; if ( n == 0 ) { return false ; } if ( ! NAME_START_CHARS . contains ( s . codePointAt ( 0 ) ) ) { return false ; } for ( int i = 1 ; i < n ; ++ i ) { if ( ! NAME_CHARS . contains ( s . charAt ( i ) ) ) { return false ; } } return true ; }
as defined in section 2 . 6 of xml version 5 .
