nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(mDocument); if (! xuldoc) return NS_ERROR_UNEXPECTED;  ContentTestNode* idnode = new ContentTestNode(mRules.GetRoot(), mConflictSet, xuldoc, mRoot, mContentVar, mContainerVar, nsnull);  if (! idnode) return NS_ERROR_OUT_OF_MEMORY;  mRules.GetRoot()->AddChild(idnode); mRules.AddNode(idnode);   RDFContainerMemberTestNode* membernode = new RDFContainerMemberTestNode(idnode, mConflictSet, mDB, mContainmentProperties, mContainerVar, mMemberVar);  if (! membernode) return NS_ERROR_OUT_OF_MEMORY;  idnode->AddChild(membernode); mRules.AddNode(membernode);  mRDFTests.Add(membernode);  *aChildNode = membernode;
nsXULTemplateBuilder::InitializeRuleNetwork(){    NS_PRECONDITION(mRoot != nsnull, "not initialized");    if (! mRoot)        return NS_ERROR_NOT_INITIALIZED;    // Determine if there are any special settings we need to observe    mFlags = 0;    nsAutoString flags;    mRoot->GetAttr(kNameSpaceID_None, nsXULAtoms::flags, flags);    if (flags.Find(NS_LITERAL_STRING("dont-test-empty")) >= 0)        mFlags |= eDontTestEmpty;    // Initialize the rule network    mRules.Clear();    mRules.Clear();    mRDFTests.Clear();    ComputeContainmentProperties();    mContainerVar = mRules.CreateAnonymousVariable();    mMemberVar = mRules.CreateAnonymousVariable();    return NS_OK;}