public static boolean isValidNCName(String ncName){
  if (ncName.length() == 0)   return false;
  char ch=ncName.charAt(0);
  if (isNCNameStart(ch) == false)   return false;
  for (int i=1; i < ncName.length(); i++) {
    ch=ncName.charAt(i);
    if (isNCName(ch) == false) {
      return false;
    }
  }
  return true;
}

public static boolean isValidNCName ( String ncName ) { if ( ncName . length ( ) == 0 ) return false ; char ch = ncName . charAt ( 0 ) ; if ( isNCNameStart ( ch ) == false ) return false ; for ( int i = 1 ; i < ncName . length ( ) ; i ++ ) { ch = ncName . charAt ( i ) ; if ( isNCName ( ch ) == false ) { return false ; } } return true ; }
check to see if a string is a valid ncname according to [ 4 ] from the xml namespaces 1 . 0 recommendation
