PRBool isvar; if (aAttributeValue[i] == PRUnichar('?')) { isvar = PR_TRUE; } else if ((aAttributeValue[i] == PRUnichar('r') && ++i < len) && (aAttributeValue[i] == PRUnichar('d') && ++i < len) && (aAttributeValue[i] == PRUnichar('f') && ++i < len) && (aAttributeValue[i] == PRUnichar(':'))) { isvar = PR_TRUE; } else { isvar = PR_FALSE; }  if (! isvar || ++i >= len) {     i = backup; aResult += aAttributeValue[i]; continue; }      PRInt32 first = backup;  while (i < len && aAttributeValue[i] != PRUnichar(' ')) ++i;  PRInt32 last = i;  nsPromiseSubstring<PRUnichar> symbol(aAttributeValue, first, last);   PRInt32 var = 0; if (symbol == NS_LITERAL_STRING("rdf:*")) var = mMemberVar; else var = aMatch.mRule->LookupSymbol(symbol);
nsXULTemplateBuilder::SubstituteText(nsIRDFResource* aResource,                                     Match* aMatch,                                     nsString& aAttributeValue){    // See if it's the special value "..." or "rdf:*", in which case    // we need to substitute the URI of aResource.    if (aAttributeValue.EqualsWithConversion("...") || aAttributeValue.EqualsWithConversion("rdf:*")) {        const char *uri = nsnull;        aResource->GetValueConst(&uri);        aAttributeValue.AssignWithConversion(uri);        return NS_OK;    }    // See if it's a variable, in which case we'll use the match    // assignments to compute the value.    if (aAttributeValue[0] == PRUnichar('?') || aAttributeValue.Find("rdf:") == 0) {        // Grab the variable out of the attribute value        PRInt32 var = aMatch->mRule->LookupSymbol(aAttributeValue);        // ...then truncate the value, in case we need to leave the party early.        aAttributeValue.Truncate();        // If there was no variable, bail.        if (! var)            return NS_OK;        Value value;        PRBool hasassignment =            aMatch->GetAssignmentFor(mConflictSet, var, &value);        // If there was no assignment for the variable, bail.        if (! hasassignment)            return NS_OK;        SubstituteTextForValue(value, aAttributeValue);    }    return NS_OK;}