public static String parseIdFromSameDocumentURI(String uri){
  if (uri.length() == 0) {
    return null;
  }
  String id=uri.substring(1);
  if (id != null && id.startsWith("xpointer(id(")) {
    int i1=id.indexOf('\'');
    int i2=id.indexOf('\'',i1 + 1);
    id=id.substring(i1 + 1,i2);
  }
  return id;
}

public static String parseIdFromSameDocumentURI ( String uri ) { if ( uri . length ( ) == 0 ) { return null ; } String id = uri . substring ( 1 ) ; if ( id != null && id . startsWith ( "xpointer(id(" ) ) { int i1 = id . indexOf ( '\'' ) ; int i2 = id . indexOf ( '\'' , i1 + 1 ) ; id = id . substring ( i1 + 1 , i2 ) ; } return id ; }
returns the id from a same - document uri ( ex : " # id " )
