if (NS_SUCCEEDED(rv = child->GetAttribute(kNameSpaceID_RDF, kResourceAtom, value))
if (NS_SUCCEEDED(rv = child->GetAttribute(kNameSpaceID_None, kResourceAtom, value))
XULSortServiceImpl::GetSortColumnIndex(nsIContent *tree, const nsString &sortResource, const nsString &sortDirection,					nsString &sortResource2, PRBool &inbetweenSeparatorSort, PRInt32 &sortColIndex, PRBool &found){	PRInt32			childIndex, colIndex = 0, numChildren, nameSpaceID;        nsCOMPtr<nsIContent>	child;	nsresult		rv;	found = PR_FALSE;	inbetweenSeparatorSort = PR_FALSE;	sortColIndex = 0;	if (NS_FAILED(rv = tree->ChildCount(numChildren)))	return(rv);	for (childIndex=0; childIndex<numChildren; childIndex++)	{		if (NS_FAILED(rv = tree->ChildAt(childIndex, *getter_AddRefs(child))))	return(rv);		if (NS_FAILED(rv = child->GetNameSpaceID(nameSpaceID)))	return(rv);		if (nameSpaceID == kNameSpaceID_XUL)		{			nsCOMPtr<nsIAtom> tag;			if (NS_FAILED(rv = child->GetTag(*getter_AddRefs(tag))))				return(rv);			if (tag.get() == kTreeColGroupAtom)			{				rv = GetSortColumnIndex(child, sortResource, sortDirection, sortResource2,					inbetweenSeparatorSort, sortColIndex, found);			}			else if (tag.get() == kTreeColAtom)			{				nsAutoString	value;				if (NS_SUCCEEDED(rv = child->GetAttribute(kNameSpaceID_RDF, kResourceAtom, value))					&& (rv == NS_CONTENT_ATTR_HAS_VALUE))				{					PRBool		setFlag = PR_FALSE;					if (value == sortResource)					{						sortColIndex = colIndex;																		if (!sortDirection.Equals(naturalStr))						{							found = PR_TRUE;							setFlag = PR_TRUE;							// secondary sort info is optional							if (NS_FAILED(rv = child->GetAttribute(kNameSpaceID_RDF, kResource2Atom,								sortResource2)) || (rv != NS_CONTENT_ATTR_HAS_VALUE))							{								sortResource2.Truncate();							}						}					}					if (NS_SUCCEEDED(rv = child->GetAttribute(kNameSpaceID_None, kSortSeparatorsAtom, value))						&& (rv == NS_CONTENT_ATTR_HAS_VALUE) && (value.EqualsIgnoreCase(trueStr)))					{						inbetweenSeparatorSort = PR_TRUE;					}					if (setFlag == PR_TRUE)					{						child->SetAttribute(kNameSpaceID_None, kSortActiveAtom, trueStr, PR_TRUE);						child->SetAttribute(kNameSpaceID_None, kSortDirectionAtom, sortDirection, PR_TRUE);						// Note: don't break out of loop; want to set/unset attribs on ALL sort columns						// break;					}					else					{						child->UnsetAttribute(kNameSpaceID_None, kSortActiveAtom, PR_TRUE);						child->UnsetAttribute(kNameSpaceID_None, kSortDirectionAtom, PR_TRUE);					}				}				++colIndex;			}		}	}	SetSortHints(tree, sortResource, sortDirection, sortResource2, inbetweenSeparatorSort, found);	return(NS_OK);}