PR_LOG(gLog, PR_LOG_ALWAYS, ("rdfxml[%p] refresh(%s) a load was pending", this, mURLSpec));
RDFXMLDataSourceImpl::Refresh(PRBool aBlocking){    // If an asynchronous load is already pending, then just let it do    // the honors.    if (mLoadPending) {        if (aBlocking) {            NS_WARNING("blocking load requested when async load pending");            return NS_ERROR_FAILURE;        }        else {            return NS_OK;        }    }    nsresult rv;    nsCOMPtr<nsINameSpaceManager> nsmgr;    rv = nsComponentManager::CreateInstance(kNameSpaceManagerCID,                                            nsnull,                                            kINameSpaceManagerIID,                                            getter_AddRefs(nsmgr));    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIRDFContentSink> sink;    rv = nsComponentManager::CreateInstance(kRDFContentSinkCID,                                            nsnull,                                            nsIRDFContentSink::GetIID(),                                            getter_AddRefs(sink));    if (NS_FAILED(rv)) return rv;    rv = sink->Init(mURL, nsmgr);    if (NS_FAILED(rv)) return rv;    // We set the content sink's data source directly to our in-memory    // store. This allows the initial content to be generated "directly".    rv = sink->SetDataSource(this);    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIParser> parser;    rv = nsComponentManager::CreateInstance(kParserCID,                                            nsnull,                                            kIParserIID,                                            getter_AddRefs(parser));    if (NS_FAILED(rv)) return rv;    nsAutoString utf8("UTF-8");    parser->SetDocumentCharset(utf8, kCharsetFromDocTypeDefault);    parser->SetContentSink(sink);    // XXX this should eventually be kRDFDTDCID (oh boy, that's a    // pretty identifier). The RDF DTD will be a much more    // RDF-resilient parser.    nsCOMPtr<nsIDTD> dtd;    rv = nsComponentManager::CreateInstance(kWellFormedDTDCID,                                            nsnull,                                            kIDTDIID,                                            getter_AddRefs(dtd));    if (NS_FAILED(rv)) return rv;    parser->RegisterDTD(dtd);    nsCOMPtr<nsIStreamListener> lsnr;    rv = parser->QueryInterface(kIStreamListenerIID, getter_AddRefs(lsnr));    if (NS_FAILED(rv)) return rv;    rv = parser->Parse(mURL);    if (NS_FAILED(rv)) return rv;    if (aBlocking) {        rv = rdf_BlockingParse(mURL, lsnr);        if (NS_FAILED(rv)) return rv;    }    else {        // Null LoadGroup ?        rv = NS_OpenURI(lsnr, nsnull, mURL, nsnull);        if (NS_FAILED(rv)) return rv;        // So we don't try to issue two asynchronous loads at once.        mLoadPending = PR_TRUE;    }    return NS_OK;}