rdf_MakeAbsoluteURI(NS_ConvertASCIItoUCS2(NS_STATIC_CAST(const char*, docURI)), uri);
rdf_MakeAbsoluteURI(NS_ConvertUTF8toUCS2(NS_STATIC_CAST(const char*, docURI)), uri);
RDFContentSinkImpl::GetIdAboutAttribute(const nsIParserNode& aNode,                                        nsIRDFResource** aResource,                                        PRBool* aIsAnonymous){    // This corresponds to the dirty work of production [6.5]    nsAutoString k;    PRInt32 ac = aNode.GetAttributeCount();    nsresult rv;    nsXPIDLCString docURI;    rv = mDocumentURL->GetSpec(getter_Copies(docURI));    if (NS_FAILED(rv)) return rv;    for (PRInt32 i = 0; i < ac; i++) {        // Get upper-cased key        const nsString& key = aNode.GetKeyAt(i);        const char* nameSpaceURI;        nsCOMPtr<nsIAtom> attr;        rv = ParseAttributeString(key, &nameSpaceURI, getter_AddRefs(attr));        if (NS_FAILED(rv)) return rv;        // We'll accept either `ID' or `rdf:ID' (ibid with `about' or        // `rdf:about') in the spirit of being liberal towards the        // input that we receive.        if (nameSpaceURI && 0 != PL_strcmp(nameSpaceURI, kRDFNameSpaceURI))            continue;        // XXX you can't specify both, but we'll just pick up the        // first thing that was specified and ignore the other.                if (attr.get() == kAboutAtom) {            if (aIsAnonymous)                *aIsAnonymous = PR_FALSE;            nsAutoString uri(aNode.GetValueAt(i));            nsRDFParserUtils::StripAndConvert(uri);            rdf_MakeAbsoluteURI(NS_ConvertASCIItoUCS2(NS_STATIC_CAST(const char*, docURI)), uri);            return gRDFService->GetUnicodeResource(uri.GetUnicode(), aResource);        }        else if (attr.get() == kIdAtom) {            if (aIsAnonymous)                *aIsAnonymous = PR_FALSE;            nsAutoString name(aNode.GetValueAt(i));            nsRDFParserUtils::StripAndConvert(name);            // Enforce that this is a valid "XML Name" (see            // http://www.w3.org/TR/REC-xml#NT-Nmtoken), as per 6.21.            //            // XXX I'm assuming that nsString::IsAlpha() is defined to            // mean http://www.w3.org/TR/REC-xml#NT-Letter, which it            // probably isn't.            PRUnichar first = name.First();            if (! nsCRT::IsAsciiAlpha(first) &&                first != PRUnichar(':') &&                first != PRUnichar('_')) {                PR_LOG(gLog, PR_LOG_ALWAYS,                       ("rdfxml: expected XML Name at line %d",                        aNode.GetSourceLineNumber()));                return NS_ERROR_FAILURE;            }            // Construct an in-line resource whose URI is the            // document's URI plus the XML name specified in the ID            // attribute.            name.Insert(NS_ConvertASCIItoUCS2("#"), 0);                        rdf_MakeAbsoluteURI(NS_ConvertASCIItoUCS2(NS_STATIC_CAST(const char*, docURI)), name);            return gRDFService->GetUnicodeResource(name.GetUnicode(), aResource);        }        else if (attr.get() == kAboutEachAtom) {            // XXX we don't deal with aboutEach...            PR_LOG(gLog, PR_LOG_ALWAYS,                   ("rdfxml: ignoring aboutEach at line %d",                    aNode.GetSourceLineNumber()));        }    }    // Otherwise, we couldn't find anything, so just gensym one...    if (aIsAnonymous)        *aIsAnonymous = PR_TRUE;    rv = gRDFService->GetAnonymousResource(aResource);    return rv;}