kNaturalOrderPosAtom            = NS_NewAtom("pos");
RDFGenericBuilderImpl::Init(){    if (gRefCnt++ == 0) {        kContainerAtom                  = NS_NewAtom("container");        kContainmentAtom                = NS_NewAtom("containment");        kEmptyAtom                      = NS_NewAtom("empty");        kIdAtom                         = NS_NewAtom("id");        kIgnoreAtom                     = NS_NewAtom("ignore");        kInstanceOfAtom                 = NS_NewAtom("instanceOf");        kIsContainerAtom                = NS_NewAtom("iscontainer");        kIsEmptyAtom                    = NS_NewAtom("isempty");        kMenuAtom                       = NS_NewAtom("menu");        kMenuPopupAtom                  = NS_NewAtom("menupopup");        kNaturalOrderPosAtom            = NS_NewAtom("pos");        kOpenAtom                       = NS_NewAtom("open");        kParentAtom                     = NS_NewAtom("parent");        kPersistAtom                    = NS_NewAtom("persist");        kPropertyAtom                   = NS_NewAtom("property");        kResourceAtom                   = NS_NewAtom("resource");        kRuleAtom                       = NS_NewAtom("rule");        kTemplateAtom                   = NS_NewAtom("template");        kTextAtom                       = NS_NewAtom("text");        kTreeAtom                       = NS_NewAtom("tree");        kTreeChildrenAtom               = NS_NewAtom("treechildren");        kTreeItemAtom                   = NS_NewAtom("treeitem");        kURIAtom                        = NS_NewAtom("uri");        kValueAtom                      = NS_NewAtom("value");        kXULContentsGeneratedAtom       = NS_NewAtom("xulcontentsgenerated");        nsresult rv;        // Register the XUL and RDF namespaces: these'll just retrieve        // the IDs if they've already been registered by someone else.        rv = nsComponentManager::CreateInstance(kNameSpaceManagerCID,                                                nsnull,                                                nsCOMTypeInfo<nsINameSpaceManager>::GetIID(),                                                (void**) &gNameSpaceManager);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create namespace manager");        if (NS_FAILED(rv)) return rv;        // XXX This is sure to change. Copied from mozilla/layout/xul/content/src/nsXULAtoms.cpp        static const char kXULNameSpaceURI[]            = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";        static const char kRDFNameSpaceURI[]            = RDF_NAMESPACE_URI;        rv = gNameSpaceManager->RegisterNameSpace(kXULNameSpaceURI, kNameSpaceID_XUL);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to register XUL namespace");        if (NS_FAILED(rv)) return rv;        rv = gNameSpaceManager->RegisterNameSpace(kRDFNameSpaceURI, kNameSpaceID_RDF);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to register RDF namespace");        if (NS_FAILED(rv)) return rv;        // Initialize the global shared reference to the service        // manager and get some shared resource objects.        rv = nsServiceManager::GetService(kRDFServiceCID,                                          kIRDFServiceIID,                                          (nsISupports**) &gRDFService);        if (NS_FAILED(rv)) return rv;        gRDFService->GetResource(NC_NAMESPACE_URI "Title",   &kNC_Title);        gRDFService->GetResource(NC_NAMESPACE_URI "child",   &kNC_child);        gRDFService->GetResource(NC_NAMESPACE_URI "Column",  &kNC_Column);        gRDFService->GetResource(NC_NAMESPACE_URI "Folder",  &kNC_Folder);        gRDFService->GetResource(RDF_NAMESPACE_URI "child",  &kRDF_child);        gRDFService->GetResource(RDF_NAMESPACE_URI "instanceOf", &kRDF_instanceOf);        gRDFService->GetResource(XUL_NAMESPACE_URI "element",    &kXUL_element);        rv = nsServiceManager::GetService(kRDFContainerUtilsCID,                                          nsIRDFContainerUtils::GetIID(),                                          (nsISupports**) &gRDFContainerUtils);        if (NS_FAILED(rv)) return rv;        rv = nsServiceManager::GetService(kXULSortServiceCID,                                          nsCOMTypeInfo<nsIXULSortService>::GetIID(),                                          (nsISupports**) &gXULSortService);        if (NS_FAILED(rv)) return rv;        rv = nsComponentManager::CreateInstance(kHTMLElementFactoryCID,                                                nsnull,                                                kIHTMLElementFactoryIID,                                                (void**) &gHTMLElementFactory);        if (NS_FAILED(rv)) return rv;        rv = nsServiceManager::GetService(kXULContentUtilsCID,                                          nsCOMTypeInfo<nsIXULContentUtils>::GetIID(),                                          (nsISupports**) &gXULUtils);        if (NS_FAILED(rv)) return rv;    }#ifdef PR_LOGGING    if (! gLog)        gLog = PR_NewLogModule("nsRDFGenericBuilder");#endif    return NS_OK;}