("rdfgeneric[%p] cannot handle variables in <triple> 'predicate'", this));
("xultemplate[%p] cannot handle variables in <triple> 'predicate'", this));
nsXULTemplateBuilder::CompileTripleCondition(Rule* aRule,                                             nsIContent* aCondition,                                             InnerNode* aParentNode,                                             TestNode** aResult){    // Compile a <triple> condition, which must be of the form:    //    //   <triple subject="?var|resource"    //           predicate="resource"    //           object="?var|resource|literal" />    //    // XXXwaterson Some day it would be cool to allow the 'predicate'    // to be bound to a variable.    // subject    nsAutoString subject;    aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::subject, subject);    PRInt32 svar = 0;    nsCOMPtr<nsIRDFResource> sres;    if (subject[0] == PRUnichar('?')) {        svar = aRule->LookupSymbol(subject);        if (! svar) {            mRules.CreateVariable(&svar);            aRule->AddSymbol(subject, svar);        }    }    else {        gRDFService->GetUnicodeResource(subject.GetUnicode(), getter_AddRefs(sres));    }    // predicate    nsAutoString predicate;    aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::predicate, predicate);    nsCOMPtr<nsIRDFResource> pres;    if (predicate[0] == PRUnichar('?')) {        PR_LOG(gLog, PR_LOG_ALWAYS,               ("rdfgeneric[%p] cannot handle variables in <triple> 'predicate'", this));        return NS_OK;    }    else {        gRDFService->GetUnicodeResource(predicate.GetUnicode(), getter_AddRefs(pres));    }    // object    nsAutoString object;    aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::object, object);    PRInt32 ovar = 0;    nsCOMPtr<nsIRDFNode> onode;    if (object[0] == PRUnichar('?')) {        ovar = aRule->LookupSymbol(object);        if (! ovar) {            mRules.CreateVariable(&ovar);            aRule->AddSymbol(object, ovar);        }    }    else if (object.FindChar(':') != -1) { // XXXwaterson evil.        // treat as resource        nsCOMPtr<nsIRDFResource> resource;        gRDFService->GetUnicodeResource(object.GetUnicode(), getter_AddRefs(resource));        onode = do_QueryInterface(resource);    }    else {        nsCOMPtr<nsIRDFLiteral> literal;        gRDFService->GetLiteral(object.GetUnicode(), getter_AddRefs(literal));        onode = do_QueryInterface(literal);    }    RDFPropertyTestNode* testnode = nsnull;    if (svar && ovar) {        testnode = new RDFPropertyTestNode(aParentNode, mDB, svar, pres, ovar);    }    else if (svar) {        testnode = new RDFPropertyTestNode(aParentNode, mDB, svar, pres, onode);    }    else if (ovar) {        testnode = new RDFPropertyTestNode(aParentNode, mDB, sres, pres, ovar);    }    else {        PR_LOG(gLog, PR_LOG_ALWAYS,               ("rdfgeneric[%p] tautology in <triple> test", this));        return NS_OK;    }    if (! testnode)        return NS_ERROR_OUT_OF_MEMORY;    mRDFTests.Add(testnode);    *aResult = testnode;    return NS_OK;}