nsCOMPtr<nsIRDFResource> pres;
return NS_OK; }  nsCOMPtr<nsIRDFResource> pred;
nsXULTemplateBuilder::CompileBinding(Rule* aRule,                                     nsIContent* aBinding){    // Compile a <binding> "condition", which must be of the form:    //    //   <binding subject="?var1"    //            predicate="resource"    //            object="?var2" />    //    // XXXwaterson Some day it would be cool to allow the 'predicate'    // to be bound to a variable.    // subject    nsAutoString subject;    aBinding->GetAttribute(kNameSpaceID_None, nsXULAtoms::subject, subject);    PRInt32 svar = 0;    if (subject[0] == PRUnichar('?')) {        svar = aRule->LookupSymbol(subject);        if (! svar) {            mRules.CreateVariable(&svar);            aRule->AddSymbol(subject, svar);        }    }    else {        PR_LOG(gLog, PR_LOG_ALWAYS,               ("xultemplate[%p] <binding> requires 'subject' to be a variable", this));        return NS_OK;    }    // predicate    nsAutoString predicate;    aBinding->GetAttribute(kNameSpaceID_None, nsXULAtoms::predicate, predicate);    nsCOMPtr<nsIRDFResource> pres;    if (predicate[0] == PRUnichar('?')) {        PR_LOG(gLog, PR_LOG_ALWAYS,               ("xultemplate[%p] cannot handle variables in <binding> 'predicate'", this));        return NS_OK;    }    else {        gRDFService->GetUnicodeResource(predicate.GetUnicode(), getter_AddRefs(pres));    }    // object    nsAutoString object;    aBinding->GetAttribute(kNameSpaceID_None, nsXULAtoms::object, object);    PRInt32 ovar = 0;    if (object[0] == PRUnichar('?')) {        ovar = aRule->LookupSymbol(object);        if (! ovar) {            mRules.CreateVariable(&ovar);            aRule->AddSymbol(object, ovar);        }    }    else {        PR_LOG(gLog, PR_LOG_ALWAYS,               ("xultemplate[%p] <binding> requires 'object' to be a variable", this));        return NS_OK;    }    return aRule->AddBinding(svar, pres, ovar);}