nsCOMPtr<nsIContent> temp = parent; rv = temp->GetParent(*getter_AddRefs(parent)); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get parent"); if (NS_FAILED(rv)) return rv; }      if (mDocument) { nsCOMPtr<nsIContent> docroot = dont_QueryInterface( mDocument->GetRootContent() );  if (docroot) { nsCOMPtr<nsIXMLContent> xml( do_QueryInterface(docroot) ); if (xml) return xml->GetContainingNameSpace(aNameSpace); }
RDFElementImpl::GetContainingNameSpace(nsINameSpace*& aNameSpace) const{    if (mNameSpace) {        NS_ADDREF(mNameSpace);        aNameSpace = mNameSpace;        return NS_OK;    }    else if (mParent) {        nsCOMPtr<nsIXMLContent> xml( do_QueryInterface(mParent) );        if (xml)            return xml->GetContainingNameSpace(aNameSpace);    }    aNameSpace = nsnull;    return NS_OK;}