RemapDTD(aFPIStr, fileName);
if (aFPIStr) { RemapDTD(aFPIStr, fileName); }
IsLoadableDTD(const XML_Char* aFPIStr, nsCOMPtr<nsIURI>* aDTD){  PRBool isLoadable = PR_FALSE;  nsresult res = NS_OK;  if (!aDTD || !*aDTD) {    NS_ASSERTION(0, "Null parameter.");    return PR_FALSE;  }  // Return true if the url is a chrome url  res = (*aDTD)->SchemeIs("chrome", &isLoadable);  // If the url is not a chrome url, check to see if a DTD file of the same name  // exists in the special DTD directory  if (!isLoadable) {    // try to see if we can map the public ID to a known local DTD    nsXPIDLCString fileName;    RemapDTD(aFPIStr, fileName);    if (fileName.IsEmpty()) {      // try to see if the user has installed the DTD file -- we extract the      // filename.ext of the DTD here. Hence, for any DTD for which we have      // no predefined mapping, users just have to copy the DTD file to our      // special DTD directory and it will be picked      nsCOMPtr<nsIURL> dtdURL;      dtdURL = do_QueryInterface(*aDTD, &res);      if (NS_FAILED(res)) {        return PR_FALSE;      }      res = dtdURL->GetFileName(getter_Copies(fileName));      if (NS_FAILED(res) || fileName.IsEmpty()) {        return PR_FALSE;      }    }    nsSpecialSystemDirectory dtdPath(nsSpecialSystemDirectory::OS_CurrentProcessDirectory);    dtdPath += PromiseFlatCString(nsDependentCString(kDTDDirectory) + fileName).get();    if (dtdPath.Exists()) {      // The DTD was found in the local DTD directory.      // Set aDTD to a file: url pointing to the local DTD      nsFileURL dtdFile(dtdPath);      nsCOMPtr<nsIURI> dtdURI;      NS_NewURI(getter_AddRefs(dtdURI), dtdFile.GetURLString());      if (dtdURI) {        *aDTD = dtdURI;        isLoadable = PR_TRUE;      }    }  }  return isLoadable;}