private PsiFile getBaseFile(String baseSystemId) {

    PsiFile baseFile = resolve(null, baseSystemId);
    if (baseFile != null) return baseFile;

    // Find relative to myFile
    File workingFile = new File("");
    String workingDir = workingFile.getAbsoluteFile().getAbsolutePath().replace(File.separatorChar, '/');
    VirtualFile parent = myFile.getVirtualFile().getParent();
    if (parent == null)
      return null;
    String id = StringUtil.replace(baseSystemId, workingDir, parent.getPath());
    VirtualFile vFile = UriUtil.findRelative(id, myFile);

    if (vFile == null) {
      vFile = UriUtil.findRelative(baseSystemId, myFile);
    }
    if (vFile == null) {
      try {
        vFile = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.convertFromUrl(new URL(baseSystemId)));
      }
      catch (MalformedURLException ignore) {
      }
    }

    if (vFile != null && !vFile.isDirectory() && !(vFile.getFileSystem() instanceof HttpFileSystem)) {
      baseFile = PsiManager.getInstance(myProject).findFile(vFile);
    }
    return baseFile;
  }
private PsiFile getBaseFile(String baseSystemId)