public static boolean sameDocumentURI(String uri){
  return (uri != null && (uri.length() == 0 || uri.charAt(0) == '#'));
}

public static boolean sameDocumentURI ( String uri ) { return ( uri != null && ( uri . length ( ) == 0 || uri . charAt ( 0 ) == '#' ) ) ; }
returns true if uri is a same - document uri , false otherwise .
