NS_ERROR("couldn't create instance of collation factory");
NS_ERROR("couldn't get locale factory");
XULSortServiceImpl::XULSortServiceImpl(void){	NS_INIT_REFCNT();	if (gRefCnt == 0)	{	        kTreeAtom            		= NS_NewAtom("tree");	        kTreeBodyAtom        		= NS_NewAtom("treebody");	        kTreeCellAtom        		= NS_NewAtom("treecell");		kTreeChildrenAtom    		= NS_NewAtom("treechildren");		kTreeColAtom         		= NS_NewAtom("treecol");		kTreeItemAtom        		= NS_NewAtom("treeitem");		kResourceAtom        		= NS_NewAtom("resource");		kTreeContentsGeneratedAtom	= NS_NewAtom("treecontentsgenerated");		kNameAtom			= NS_NewAtom("Name");		kSortAtom			= NS_NewAtom("sortActive");		kSortDirectionAtom		= NS_NewAtom("sortDirection");		kIdAtom				= NS_NewAtom("id");		kNaturalOrderPosAtom		= NS_NewAtom("pos");		kRDF_type			= NS_NewAtom("type"); 		nsresult rv;		if (NS_FAILED(rv = nsServiceManager::GetService(kRDFServiceCID,						  kIRDFServiceIID, (nsISupports**) &gRDFService)))		{			NS_ERROR("couldn't create rdf service");		}		nsICollationFactory	*colFactory;		if (NS_SUCCEEDED(rv = nsComponentManager::CreateInstance(kCollationFactoryCID, NULL,				kICollationFactoryIID, (void**) &colFactory)))		{			// Temporary: pass null until bug#3867 is fixed			if (NS_FAILED(rv = colFactory->CreateCollation(nsnull/*locale*/, &collationService)))			{				NS_ERROR("couldn't create collation instance");			}		}		else		{			NS_ERROR("couldn't create instance of collation factory");		}		gRDFService->GetResource(kURINC_Name, &kNC_Name);	        // Register the XUL and RDF namespaces: these'll just retrieve	        // the IDs if they've already been registered by someone else.		nsINameSpaceManager* mgr;		if (NS_SUCCEEDED(rv = nsComponentManager::CreateInstance(kNameSpaceManagerCID,		                           nsnull,		                           kINameSpaceManagerIID,		                           (void**) &mgr)))		{static const char kRDFNameSpaceURI[]    = RDF_NAMESPACE_URI;			rv = mgr->RegisterNameSpace(kXULNameSpaceURI, kNameSpaceID_XUL);			NS_ASSERTION(NS_SUCCEEDED(rv), "unable to register XUL namespace");			rv = mgr->RegisterNameSpace(kRDFNameSpaceURI, kNameSpaceID_RDF);			NS_ASSERTION(NS_SUCCEEDED(rv), "unable to register RDF namespace");			NS_RELEASE(mgr);		}		else		{			NS_ERROR("couldn't create namepsace manager");		}	}	++gRefCnt;}