nsAutoString attr; rv = aAttribute->ToString(attr);
PRUnichar buf[256]; nsAutoString uri(CBufDescriptor(buf, PR_TRUE, sizeof(buf) / sizeof(PRUnichar), 0)); if (aNameSpaceID != kNameSpaceID_Unknown && aNameSpaceID != kNameSpaceID_None) { rv = gNameSpaceManager->GetNameSpaceURI(aNameSpaceID, uri);  }   if (uri.Length() > 0 && uri.Last() != '#' && uri.Last() != '/' && aAttribute.First() != '#') uri.Append('#');  uri.Append(aAttribute);  rv = gRDF->GetUnicodeResource(uri.GetUnicode(), aResult); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");
nsXULContentUtils::GetResource(PRInt32 aNameSpaceID, nsIAtom* aAttribute, nsIRDFResource** aResult){    // construct a fully-qualified URI from the namespace/tag pair.    NS_PRECONDITION(aAttribute != nsnull, "null ptr");    if (! aAttribute)        return NS_ERROR_NULL_POINTER;    nsresult rv;    nsAutoString attr;    rv = aAttribute->ToString(attr);    if (NS_FAILED(rv)) return rv;    return GetResource(aNameSpaceID, attr, aResult);}