res = mRDFService->GetLiteral(title, getter_AddRefs(titleLiteral));
res = aRDFServ->GetLiteral(title, getter_AddRefs(titleLiteral)); if (NS_FAILED(res)) return res; res = Assert(node, kNC_Name, titleLiteral, PR_TRUE);
nsresult nsCharsetMenu::AddMenuItemToContainer(                        nsIRDFContainer * aContainer,                        nsMenuEntry * aItem,                        nsIRDFResource * aType,                        char * aIDPrefix,                        PRInt32 aPlace) {  nsresult res = NS_OK;  nsCOMPtr<nsIRDFResource> node;  nsAutoString cs;  res = aItem->mCharset->ToString(cs);  if (NS_FAILED(res)) return res;  nsAutoString id;  if (aIDPrefix != NULL) id.AssignWithConversion(aIDPrefix);  id.Append(cs);  // Make up a unique ID and create the RDF NODE  char csID[256];  id.ToCString(csID, sizeof(csID));  res = mRDFService->GetResource(csID, getter_AddRefs(node));  if (NS_FAILED(res)) return res;  const PRUnichar * title = aItem->mTitle.GetUnicode();  // set node's title  nsCOMPtr<nsIRDFLiteral> titleLiteral;  res = mRDFService->GetLiteral(title, getter_AddRefs(titleLiteral));  if (NS_FAILED(res)) return res;  if (aPlace < -1) {    res = Unassert(node, kNC_Name, titleLiteral);    if (NS_FAILED(res)) return res;  } else {    res = Assert(node, kNC_Name, titleLiteral, PR_TRUE);    if (NS_FAILED(res)) return res;  }  if (aType != NULL) {    if (aPlace < -1) {      res = Unassert(node, kRDF_type, aType);      if (NS_FAILED(res)) return res;    } else {      res = Assert(node, kRDF_type, aType, PR_TRUE);      if (NS_FAILED(res)) return res;    }  }  // Add the element to the container  if (aPlace < -1) {    res = aContainer->RemoveElement(node, PR_TRUE);    if (NS_FAILED(res)) return res;  } else if (aPlace < 0) {    res = aContainer->AppendElement(node);    if (NS_FAILED(res)) return res;  } else {    res = aContainer->InsertElementAt(node, aPlace, PR_TRUE);    if (NS_FAILED(res)) return res;  }   return res;}