if (!mDataSource || !mContainer) return NS_ERROR_NOT_INITIALIZED;
RDFContainerImpl::InsertElementAt(nsIRDFNode *aElement, PRInt32 aIndex, PRBool aRenumber){    NS_PRECONDITION(aElement != nsnull, "null ptr");    if (! aElement)        return NS_ERROR_NULL_POINTER;    NS_PRECONDITION(aIndex >= 1, "illegal value");    if (aIndex < 1)        return NS_ERROR_ILLEGAL_VALUE;    nsresult rv;    PRInt32 count;    rv = GetCount(&count);    if (NS_FAILED(rv)) return rv;    NS_ASSERTION(aIndex <= count + 1, "illegal value");    if (aIndex > count + 1)        return NS_ERROR_ILLEGAL_VALUE;    if (aRenumber) {        // Make a hole for the element. This will have the side effect of        // completely renumbering the container from 'aIndex' to 'count',        // and will spew assertions.        rv = Renumber(aIndex, +1);        if (NS_FAILED(rv)) return rv;    }    nsCOMPtr<nsIRDFResource> ordinal;    rv = gRDFContainerUtils->IndexToOrdinalResource(aIndex, getter_AddRefs(ordinal));    if (NS_FAILED(rv)) return rv;    rv = mDataSource->Assert(mContainer, ordinal, aElement, PR_TRUE);    if (NS_FAILED(rv)) return rv;    return NS_OK;}