nsAutoString uri; if (NS_FAILED(rv = element->GetAttribute(kNameSpaceID_RDF, kIdAtom, uri))) { NS_ERROR("severe error retrieving attribute"); return rv; }  if (rv != NS_CONTENT_ATTR_HAS_VALUE) { NS_ERROR("tree element has no RDF:ID"); return NS_ERROR_UNEXPECTED; }  nsCOMPtr<nsIRDFResource> resource; if (NS_FAILED(rv = gRDFService->GetUnicodeResource(uri, aResource))) { NS_ERROR("unable to create resource"); return rv; }  return NS_OK;
return GetElementResource(element, aResource);
RDFTreeBuilderImpl::GetDOMNodeResource(nsIDOMNode* aNode, nsIRDFResource** aResource){    nsresult rv;    // Given an nsIDOMNode that presumably has been created as a proxy    // for an RDF resource, pull the RDF resource information out of    // it.    nsCOMPtr<nsIContent> element;    if (NS_FAILED(rv = aNode->QueryInterface(kIContentIID, getter_AddRefs(element) ))) {        NS_ERROR("DOM element doesn't support nsIContent");        return rv;    }    nsAutoString uri;    if (NS_FAILED(rv = element->GetAttribute(kNameSpaceID_RDF,                                             kIdAtom,                                             uri))) {        NS_ERROR("severe error retrieving attribute");        return rv;    }    if (rv != NS_CONTENT_ATTR_HAS_VALUE) {        NS_ERROR("tree element has no RDF:ID");        return NS_ERROR_UNEXPECTED;    }    nsCOMPtr<nsIRDFResource> resource;    if (NS_FAILED(rv = gRDFService->GetUnicodeResource(uri, aResource))) {        NS_ERROR("unable to create resource");        return rv;    }    return NS_OK;}