nsCOMPtr<nsIAtom> kIdAtom( dont_AddRef(NS_NewAtom("id")) ); rv = aElement->GetAttribute(kNameSpaceID_None, kIdAtom, id);
rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::id, id);
nsXULContentUtils::GetElementResource(nsIContent* aElement, nsIRDFResource** aResult){    // Perform a reverse mapping from an element in the content model    // to an RDF resource.    nsresult rv;    PRUnichar buf[128];    nsAutoString id(CBufDescriptor(buf, PR_TRUE, sizeof(buf) / sizeof(PRUnichar), 0));    nsCOMPtr<nsIAtom> kIdAtom( dont_AddRef(NS_NewAtom("id")) );    rv = aElement->GetAttribute(kNameSpaceID_None, kIdAtom, id);    NS_ASSERTION(NS_SUCCEEDED(rv), "severe error retrieving attribute");    if (NS_FAILED(rv)) return rv;    if (rv != NS_CONTENT_ATTR_HAS_VALUE)        return NS_ERROR_FAILURE;    // Since the element will store its ID attribute as a document-relative value,    // we may need to qualify it first...    nsCOMPtr<nsIDocument> doc;    rv = aElement->GetDocument(*getter_AddRefs(doc));    if (NS_FAILED(rv)) return rv;    NS_ASSERTION(doc != nsnull, "element is not in any document");    if (! doc)        return NS_ERROR_FAILURE;    rv = nsXULContentUtils::MakeElementResource(doc, id, aResult);    if (NS_FAILED(rv)) return rv;    return NS_OK;}