nsGenericAttribute* attr = (nsGenericAttribute*)mAttributes->ElementAt(aIndex);
nsXULAttribute* attr = (nsXULAttribute*)mAttributes->ElementAt(aIndex);
RDFElementImpl::GetAttributeNameAt(PRInt32 aIndex,                                   PRInt32& aNameSpaceID,                                   nsIAtom*& aName) const{#if defined(CREATE_PROPERTIES_AS_ATTRIBUTES)    // XXX I'm not sure if we should support attributes or not...    nsIRDFService* mgr = nsnull;    if (NS_FAILED(rv = nsServiceManager::GetService(kRDFServiceCID,                                                    kIRDFServiceIID,                                                    (nsISupports**) &mgr)))        return rv;        nsIRDFCompositeDataSource* db = nsnull;    nsIRDFCursor* properties = nsnull;    PRBool moreProperties;    if (NS_FAILED(rv = mDocument->GetDataBase(db)))        goto done;    if (NS_FAILED(rv = db->ArcLabelsOut(mResource, properties)))        goto done;    while (NS_SUCCEEDED(rv = properties->HasMoreElements(moreProperties)) && moreProperties) {        nsIRDFNode* property = nsnull;        PRBool tv;        if (NS_FAILED(rv = properties->GetNext(property, tv /* ignored */)))            break;        nsAutoString uri;        if (NS_SUCCEEDED(rv = property->GetStringValue(uri))) {            nsIAtom* atom = NS_NewAtom(uri);            if (atom) {                aArray->AppendElement(atom);                ++aResult;            } else {                rv = NS_ERROR_OUT_OF_MEMORY;            }        }        NS_RELEASE(property);        if (NS_FAILED(rv))            break;    }done:    NS_IF_RELEASE(properties);    NS_IF_RELEASE(db);    nsServiceManager::ReleaseService(kRDFServiceCID, mgr);    return rv;#endif // defined(CREATE_PROPERTIES_AS_ATTRIBUTES)    if (nsnull != mAttributes) {        nsGenericAttribute* attr = (nsGenericAttribute*)mAttributes->ElementAt(aIndex);        if (nsnull != attr) {            aNameSpaceID = attr->mNameSpaceID;            aName        = attr->mName;            NS_IF_ADDREF(aName);            return NS_OK;        }    }    aNameSpaceID = kNameSpaceID_None;    aName = nsnull;    return NS_ERROR_ILLEGAL_VALUE;}