if (rv != NS_CONTENT_ATTR_HAS_VALUE) continue;  if (! uri.Equals(resourceURI))
if (resource != aResource)
RDFTreeBuilderImpl::FindChildByTagAndResource(nsIContent* aElement,                                              PRInt32 aNameSpaceID,                                              nsIAtom* aTag,                                              nsIRDFResource* aResource,                                              nsIContent** aChild){    nsresult rv;    const char* resourceURI;    if (NS_FAILED(rv = aResource->GetValue(&resourceURI)))        return rv;    PRInt32 count;    if (NS_FAILED(rv = aElement->ChildCount(count)))        return rv;    for (PRInt32 i = 0; i < count; ++i) {        nsCOMPtr<nsIContent> kid;        if (NS_FAILED(rv = aElement->ChildAt(i, *getter_AddRefs(kid))))            return rv; // XXX fatal        // Make sure it's a <xul:treecell>        PRInt32 nameSpaceID;        if (NS_FAILED(rv = kid->GetNameSpaceID(nameSpaceID)))            return rv; // XXX fatal        if (nameSpaceID != aNameSpaceID)            continue; // wrong namespace        nsCOMPtr<nsIAtom> tag;        if (NS_FAILED(rv = kid->GetTag(*getter_AddRefs(tag))))            return rv; // XXX fatal        if (tag.get() != aTag)            continue; // wrong tag        // Now get the resource ID from the RDF:ID attribute. We do it        // via the content model, because you're never sure who        // might've added this stuff in...        nsAutoString uri;        if (NS_FAILED(rv = kid->GetAttribute(kNameSpaceID_RDF, kIdAtom, uri))) {            NS_ERROR("severe error retrieving attribute");            return rv; // XXX fatal        }        if (rv != NS_CONTENT_ATTR_HAS_VALUE)            continue;        if (! uri.Equals(resourceURI))            continue; // not the resource we want        // Fount it!        *aChild = kid;        NS_ADDREF(*aChild);        return NS_OK;    }    return NS_ERROR_RDF_NO_VALUE; // not found}