nsCAutoString docURI; rv = mDocumentURL->GetSpec(docURI); if (NS_FAILED(rv)) return rv;
RDFContentSinkImpl::GetIdAboutAttribute(const PRUnichar** aAttributes,                                        nsIRDFResource** aResource,                                        PRBool* aIsAnonymous){    // This corresponds to the dirty work of production [6.5]    nsresult rv;    nsCAutoString docURI;    rv = mDocumentURL->GetSpec(docURI);    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIAtom> localName;    for (; *aAttributes; aAttributes += 2) {        const nsDependentSubstring& nameSpaceURI =            SplitExpatName(aAttributes[0], getter_AddRefs(localName));        // 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.IsEmpty() &&            !nameSpaceURI.EqualsLiteral(RDF_NAMESPACE_URI)) {          continue;        }        // XXX you can't specify both, but we'll just pick up the        // first thing that was specified and ignore the other.              if (localName == kAboutAtom) {            if (aIsAnonymous)                *aIsAnonymous = PR_FALSE;            nsAutoString uri(aAttributes[1]);            nsRDFParserUtils::StripAndConvert(uri);            rdf_MakeAbsoluteURI(NS_ConvertUTF8toUCS2(docURI), uri);            return gRDFService->GetUnicodeResource(uri, aResource);        }        else if (localName == kIdAtom) {            if (aIsAnonymous)                *aIsAnonymous = PR_FALSE;            nsAutoString name(aAttributes[1]);            nsRDFParserUtils::StripAndConvert(name);            // In the spirit of leniency, we do not bother trying to            // enforce that this be a valid "XML Name" (see            // http://www.w3.org/TR/REC-xml#NT-Nmtoken), as per            // 6.21. If we wanted to, this would be where to do it.            // Construct an in-line resource whose URI is the            // document's URI plus the XML name specified in the ID            // attribute.            name.Insert(PRUnichar('#'), 0);                      rdf_MakeAbsoluteURI(NS_ConvertUTF8toUCS2(docURI), name);            return gRDFService->GetUnicodeResource(name, aResource);        }        else if (localName == kAboutEachAtom) {            // XXX we don't deal with aboutEach...            //PR_LOG(gLog, PR_LOG_WARNING,            //       ("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;}