if ((attribNameSpaceID == kNameSpaceID_XUL) && (attribAtom.get() == kContainerAtom)) {  nsAutoString	nodeValue; if (NS_SUCCEEDED(aNode->GetAttribute(kNameSpaceID_RDF, kContainerAtom, nodeValue))) { if (nodeValue.EqualsIgnoreCase(attribValue)) { *matchingRuleFound = PR_TRUE; break; } } } } return(rv);
for (PRInt32 loop=0; loop<count; loop++) { PRInt32 attrNameSpaceID; nsCOMPtr<nsIAtom> attr; rv = aRule->GetAttributeNameAt(loop, attrNameSpaceID, *getter_AddRefs(attr)); if (NS_FAILED(rv)) return rv;     if ((attr.get() == kPropertyAtom) && (attrNameSpaceID == kNameSpaceID_RDF)) continue;  else if ((attr.get() == kInstanceOfAtom) && (attrNameSpaceID == kNameSpaceID_RDF)) continue;  else if ((attr.get() == kIdAtom) && (attrNameSpaceID == kNameSpaceID_None)) continue;  else if ((attr.get() == kXULContentsGeneratedAtom) && (attrNameSpaceID == kNameSpaceID_None)) continue;  nsAutoString value; rv = aRule->GetAttribute(attrNameSpaceID, attr, value); if (NS_FAILED(rv)) return rv;  if ((attrNameSpaceID == kNameSpaceID_None) && (attr.get() == kParentAtom)) { PRBool match; rv = TagMatches(aElement, value, &match); if (NS_FAILED(rv)) return rv;  if (! match) { *aIsMatch = PR_FALSE; return NS_OK; } } else if ((attrNameSpaceID == kNameSpaceID_None) && (attr.get() == kIsContainerAtom)) {  PRBool isContainer = IsContainer(aRule, aChild); if (isContainer && (!value.Equals(trueStr))) { *aIsMatch = PR_FALSE; return NS_OK; } else if (!isContainer && (!value.Equals(falseStr))) { *aIsMatch = PR_FALSE; return NS_OK; } } else if ((attrNameSpaceID == kNameSpaceID_None) && (attr.get() == kIsEmptyAtom)) { PRBool isEmpty = IsEmpty(aRule, aChild); if (isEmpty && (!value.Equals(trueStr))) { *aIsMatch = PR_FALSE; return NS_OK; } else if (!isEmpty && (!value.Equals(falseStr))) { *aIsMatch = PR_FALSE; return NS_OK; } } else { nsCOMPtr<nsIRDFResource> property; rv = gXULUtils->GetResource(attrNameSpaceID, attr, getter_AddRefs(property)); if (NS_FAILED(rv)) return rv;  nsCOMPtr<nsIRDFNode> target; rv = mDB->GetTarget(aChild, property, PR_TRUE, getter_AddRefs(target)); if (NS_FAILED(rv)) return rv;  PRUnichar buf[128]; nsAutoString targetStr(CBufDescriptor(buf, PR_TRUE, sizeof(buf) / sizeof(PRUnichar), 0)); rv = gXULUtils->GetTextForNode(target, targetStr); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get text for target"); if (NS_FAILED(rv)) return rv;  if (!value.Equals(targetStr)) { *aIsMatch = PR_FALSE; return NS_OK; } } }  *aIsMatch = PR_TRUE; return NS_OK;
RDFGenericBuilderImpl::IsTemplateRuleMatch(nsIContent *aNode, nsIContent *aRule, PRBool *matchingRuleFound){	nsresult		rv = NS_OK;	PRInt32			count;	*matchingRuleFound = PR_FALSE;	if (NS_FAILED(rv = aRule->GetAttributeCount(count)))	return(rv);	for (PRInt32 loop=0; loop<count; loop++)	{		PRInt32			attribNameSpaceID;		nsCOMPtr<nsIAtom>	attribAtom;		if (NS_FAILED(rv = aRule->GetAttributeNameAt(loop, attribNameSpaceID, *getter_AddRefs(attribAtom))))			continue;		nsAutoString		attribValue;		if (NS_FAILED(rv = aRule->GetAttribute(attribNameSpaceID, attribAtom, attribValue)))			continue;		if ((attribNameSpaceID == kNameSpaceID_XUL) && (attribAtom.get() == kContainerAtom))		{			// check and see if aNode is a container			nsAutoString	nodeValue;			if (NS_SUCCEEDED(aNode->GetAttribute(kNameSpaceID_RDF, kContainerAtom, nodeValue)))			{				if (nodeValue.EqualsIgnoreCase(attribValue))				{					*matchingRuleFound = PR_TRUE;					break;				}			}		}	}	return(rv);}