rv = CallGetService("@mozilla.org/parser/parser-service;1", &gTxParserService); if (NS_FAILED(rv)) { gTxParserService = nsnull; return rv; }
Initialize(nsIModule* aSelf){    NS_PRECONDITION(!gInitialized, "module already initialized");    if (gInitialized)        return NS_OK;    gInitialized = PR_TRUE;    gXPathExceptionProvider = new nsXPathExceptionProvider();    if (!gXPathExceptionProvider)        return NS_ERROR_OUT_OF_MEMORY;    NS_ADDREF(gXPathExceptionProvider);    nsCOMPtr<nsIExceptionService> xs =        do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID);    if (xs)        xs->RegisterExceptionProvider(gXPathExceptionProvider,                                      NS_ERROR_MODULE_DOM_XPATH);    if (!txXSLTProcessor::init()) {        return NS_ERROR_OUT_OF_MEMORY;    }    nsresult rv = CallGetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID,                                 &gTxSecurityManager);    if (NS_FAILED(rv)) {        gTxSecurityManager = nsnull;        return rv;    }    rv = CallGetService(NS_NAMESPACEMANAGER_CONTRACTID, &gTxNameSpaceManager);    if (NS_FAILED(rv)) {        gTxNameSpaceManager = nsnull;        return rv;    }    nsCOMPtr<nsIErrorService> errorService =        do_GetService(NS_ERRORSERVICE_CONTRACTID);    if (errorService) {        errorService->RegisterErrorStringBundle(NS_ERROR_MODULE_XSLT,                                                XSLT_MSGS_URL);    }    return NS_OK;}