nsIRDFLiteral* literal; if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(value.get(), &literal))) { nsCOMPtr<nsIRDFContainer> container; NS_NewRDFContainer(getter_AddRefs(container)); container->Init(mDataSource, GetContextElement(1)); container->AppendElement(literal); NS_RELEASE(literal); }
nsCOMPtr<nsIRDFContainer> container; NS_NewRDFContainer(getter_AddRefs(container)); container->Init(mDataSource, GetContextElement(1));  container->AppendElement(node);
RDFContentSinkImpl::FlushText(PRBool aCreateTextNode, PRBool* aDidFlush){    nsresult rv = NS_OK;    PRBool didFlush = PR_FALSE;    if (0 != mTextLength) {        if (aCreateTextNode && rdf_IsDataInBuffer(mText, mTextLength)) {            // XXX if there's anything but whitespace, then we'll            // create a text node.            switch (mState) {            case eRDFContentSinkState_InMemberElement: {                nsAutoString value;                value.Append(mText, mTextLength);                value.Trim(" \t\n\r");                nsIRDFLiteral* literal;                if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(value.get(), &literal))) {                    nsCOMPtr<nsIRDFContainer> container;                    NS_NewRDFContainer(getter_AddRefs(container));                    container->Init(mDataSource, GetContextElement(1));                    container->AppendElement(literal);                    NS_RELEASE(literal);                }            } break;            case eRDFContentSinkState_InPropertyElement: {                nsAutoString value;                value.Append(mText, mTextLength);                value.Trim(" \t\n\r");                nsCOMPtr<nsIRDFLiteral> target;                rv = gRDFService->GetLiteral(value.get(), getter_AddRefs(target));                if (NS_FAILED(rv)) return rv;                rv = mDataSource->Assert(GetContextElement(1), GetContextElement(0), target, PR_TRUE);                if (NS_FAILED(rv)) return rv;            } break;            default:                // just ignore it                break;            }        }        mTextLength = 0;        didFlush = PR_TRUE;    }    if (nsnull != aDidFlush) {        *aDidFlush = didFlush;    }    return rv;}