PRUnichar buf[256]; nsFixedString uri(buf, NS_ARRAY_LENGTH(buf), 0); if (aNameSpaceID != kNameSpaceID_Unknown && aNameSpaceID != kNameSpaceID_None) { rv = nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, uri);  }   if (!uri.IsEmpty()  && uri.Last() != '#' && uri.Last() != '/' && aAttribute.First() != '#') uri.Append(PRUnichar('#'));  uri.Append(aAttribute);  rv = gRDF->GetUnicodeResource(uri, aResult); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");
nsAutoString attr; rv = aAttribute->ToString(attr);
nsXULContentUtils::GetResource(PRInt32 aNameSpaceID, const nsAString& aAttribute, nsIRDFResource** aResult){    // construct a fully-qualified URI from the namespace/tag pair.    // XXX should we allow nodes with no namespace???    //NS_PRECONDITION(aNameSpaceID != kNameSpaceID_Unknown, "no namespace");    //if (aNameSpaceID == kNameSpaceID_Unknown)    //    return NS_ERROR_UNEXPECTED;    nsresult rv;    PRUnichar buf[256];    nsFixedString uri(buf, NS_ARRAY_LENGTH(buf), 0);    if (aNameSpaceID != kNameSpaceID_Unknown && aNameSpaceID != kNameSpaceID_None) {        rv = nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, uri);        // XXX ignore failure; treat as "no namespace"    }    // XXX check to see if we need to insert a '/' or a '#'. Oy.    if (!uri.IsEmpty()  && uri.Last() != '#' && uri.Last() != '/' && aAttribute.First() != '#')        uri.Append(PRUnichar('#'));    uri.Append(aAttribute);    rv = gRDF->GetUnicodeResource(uri, aResult);    NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");    if (NS_FAILED(rv)) return rv;    return NS_OK;}