aBinding->GetAttr(kNameSpaceID_None, nsXULAtoms::subject, subject);  if (subject.IsEmpty()) { PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("xultemplate[%p] <binding> requires `subject'", this));  return NS_OK; }
aBinding->GetAttribute(kNameSpaceID_None, nsXULAtoms::subject, subject);
nsXULTemplateBuilder::CompileBinding(nsTemplateRule* 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->GetAttr(kNameSpaceID_None, nsXULAtoms::subject, subject);    if (subject.IsEmpty()) {        PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,               ("xultemplate[%p] <binding> requires `subject'", this));        return NS_OK;    }    PRInt32 svar = 0;    if (subject[0] == PRUnichar('?')) {        svar = mRules.LookupSymbol(subject.get(), PR_TRUE);    }    else {        PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,               ("xultemplate[%p] <binding> requires `subject' to be a variable", this));        return NS_OK;    }    // predicate    nsAutoString predicate;    aBinding->GetAttr(kNameSpaceID_None, nsXULAtoms::predicate, predicate);    if (predicate.IsEmpty()) {        PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,               ("xultemplate[%p] <binding> requires `predicate'", this));        return NS_OK;    }    nsCOMPtr<nsIRDFResource> pred;    if (predicate[0] == PRUnichar('?')) {        PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,               ("xultemplate[%p] cannot handle variables in <binding> `predicate'", this));        return NS_OK;    }    else {        gRDFService->GetUnicodeResource(predicate.get(), getter_AddRefs(pred));    }    // object    nsAutoString object;    aBinding->GetAttr(kNameSpaceID_None, nsXULAtoms::object, object);    if (object.IsEmpty()) {        PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,               ("xultemplate[%p] <binding> requires `object'", this));        return NS_OK;    }    PRInt32 ovar = 0;    if (object[0] == PRUnichar('?')) {        ovar = mRules.LookupSymbol(object.get(), PR_TRUE);    }    else {        PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,               ("xultemplate[%p] <binding> requires `object' to be a variable", this));        return NS_OK;    }    return aRule->AddBinding(svar, pred, ovar);}