("rdfgeneric[%p] remove-member %s->%s [%s]",
("xultemplate[%p] remove-member %s->%s [%s]",
nsXULTemplateBuilder::RemoveMember(nsIContent* aContainerElement,                                   nsIRDFResource* aMember,                                   PRBool aNotify){    // This works as follows. It finds all of the elements in the    // document that correspond to aMember. Any that are contained    // within aContainerElement are removed from their direct parent.    nsresult rv;    nsCOMPtr<nsISupportsArray> elements;    rv = NS_NewISupportsArray(getter_AddRefs(elements));    if (NS_FAILED(rv)) return rv;    rv = GetElementsForResource(aMember, elements);    if (NS_FAILED(rv)) return rv;    PRUint32 cnt;    rv = elements->Count(&cnt);    if (NS_FAILED(rv)) return rv;    for (PRInt32 i = PRInt32(cnt) - 1; i >= 0; --i) {        nsISupports* isupports = elements->ElementAt(i);        nsCOMPtr<nsIContent> child( do_QueryInterface(isupports) );        NS_IF_RELEASE(isupports);        if (! gXULUtils->IsContainedBy(child, aContainerElement))            continue;        nsCOMPtr<nsIContent> parent;        rv = child->GetParent(*getter_AddRefs(parent));        if (NS_FAILED(rv)) return rv;        PRInt32 pos;        rv = parent->IndexOf(child, pos);        if (NS_FAILED(rv)) return rv;        NS_ASSERTION(pos >= 0, "parent doesn't think this child has an index");        if (pos < 0) continue;        rv = parent->RemoveChildAt(pos, PR_TRUE);        if (NS_FAILED(rv)) return rv;        // Set its document to null so that it'll get knocked out of        // the XUL doc's resource-to-element map.        rv = child->SetDocument(nsnull, PR_TRUE);        if (NS_FAILED(rv)) return rv;        // Remove from the content support map.        mContentSupportMap.Remove(child);#ifdef PR_LOGGING        if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {            nsCOMPtr<nsIAtom> parentTag;            rv = parent->GetTag(*getter_AddRefs(parentTag));            if (NS_FAILED(rv)) return rv;            nsAutoString parentTagStr;            rv = parentTag->ToString(parentTagStr);            if (NS_FAILED(rv)) return rv;            nsCOMPtr<nsIAtom> childTag;            rv = child->GetTag(*getter_AddRefs(childTag));            if (NS_FAILED(rv)) return rv;            nsAutoString childTagStr;            rv = childTag->ToString(childTagStr);            if (NS_FAILED(rv)) return rv;            const char* resourceCStr;            rv = aMember->GetValueConst(&resourceCStr);            if (NS_FAILED(rv)) return rv;                        PR_LOG(gLog, PR_LOG_ALWAYS,                   ("rdfgeneric[%p] remove-member %s->%s [%s]",                    this,                    (const char*) nsCAutoString(parentTagStr),                    (const char*) nsCAutoString(childTagStr),                    resourceCStr));        }#endif    }    return NS_OK;}