PRInt32 count; element->GetAttributeCount(count);
PRUint32 count = element->GetAttrCount();
nsXULTemplateBuilder::AddSimpleRuleBindings(Rule* aRule, nsIContent* aElement){    // Crawl the content tree of a "simple" rule, adding a variable    // assignment for any attribute whose value is "rdf:".    nsAutoVoidArray elements;    elements.AppendElement(aElement);    while (elements.Count()) {        // Pop the next element off the stack        PRInt32 i = elements.Count() - 1;        nsIContent* element = NS_STATIC_CAST(nsIContent*, elements[i]);        elements.RemoveElementAt(i);        // Iterate through its attributes, looking for substitutions        // that we need to add as bindings.        PRInt32 count;        element->GetAttributeCount(count);        for (i = 0; i < count; ++i) {            PRInt32 nameSpaceID;            nsCOMPtr<nsIAtom> attr;            element->GetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attr));            nsAutoString value;            element->GetAttribute(nameSpaceID, attr, value);            // If it's not "rdf:something", or it's "rdf:*", then            // mosey along. We don't care.            if (value.Find("rdf:") != 0 || value[4] == PRUnichar('*'))                continue;            // Check to see if we've already seen this property. We'll            // know because we'll have already added a symbol for it.            PRInt32 var = aRule->LookupSymbol(value);            if (var != 0)                continue;            // Strip it down to the raw RDF property            nsAutoString propertyStr;            value.Right(propertyStr, value.Length() - 4);            nsCOMPtr<nsIRDFResource> property;            gRDFService->GetUnicodeResource(propertyStr.GetUnicode(), getter_AddRefs(property));            // Create a new variable that we'll binding to the            // property's value            mRules.CreateVariable(&var);            aRule->AddSymbol(value, var);            // In the simple syntax, the binding is always from the            // member variable, through the property, to the target.            aRule->AddBinding(mMemberVar, property, var);        }        // Push kids onto the stack, and search them next.        element->ChildCount(count);        while (--count >= 0) {            nsCOMPtr<nsIContent> child;            element->ChildAt(count, *getter_AddRefs(child));            elements.AppendElement(child);        }    }    return NS_OK;}