public static int findURISplitIndex(String uri){
  int uriLength=uri.length();
  int i=uriLength - 1;
  while (i >= 0) {
    char c=uri.charAt(i);
    if (c == '#' || c == '/' || !XMLUtil.isNCNameChar(c)) {
      break;
    }
    i--;
  }
  i++;
  while (i < uriLength) {
    char c=uri.charAt(i);
    if (c == '_' || XMLUtil.isLetter(c)) {
      break;
    }
    i++;
  }
  if (i == uriLength) {
    i=-1;
  }
  return i;
}

public static int findURISplitIndex ( String uri ) { int uriLength = uri . length ( ) ; int i = uriLength - 1 ; while ( i >= 0 ) { char c = uri . charAt ( i ) ; if ( c == '#' || c == '/' || ! XMLUtil . isNCNameChar ( c ) ) { break ; } i -- ; } i ++ ; while ( i < uriLength ) { char c = uri . charAt ( i ) ; if ( c == '_' || XMLUtil . isLetter ( c ) ) { break ; } i ++ ; } if ( i == uriLength ) { i = - 1 ; } return i ; }
tries to find a point in the supplied uri where this uri can be safely split into a namespace part and a local name . according to the xml specifications , a local name must start with a letter or underscore and can be followed by zero or more ' ncname ' characters .
