nsXPIDLCString p; if (NS_SUCCEEDED(rv = resource->GetValue( getter_Copies(p) ))) {
const char	*p = nsnull; if (NS_SUCCEEDED(rv = resource->GetValueConst( &p )) && (p)) {
nsBookmarksService::GetTextForNode(nsIRDFNode* aNode, nsString& aResult){    nsresult		rv;    nsIRDFResource	*resource;    nsIRDFLiteral	*literal;    nsIRDFDate		*dateLiteral;    nsIRDFInt		*intLiteral;    if (! aNode) {        aResult.Truncate();        rv = NS_OK;    }    else if (NS_SUCCEEDED(rv = aNode->QueryInterface(kIRDFResourceIID, (void**) &resource))) {        nsXPIDLCString p;        if (NS_SUCCEEDED(rv = resource->GetValue( getter_Copies(p) ))) {            aResult = p;        }        NS_RELEASE(resource);    }    else if (NS_SUCCEEDED(rv = aNode->QueryInterface(kIRDFDateIID, (void**) &dateLiteral))) {	PRInt64		theDate, million;        if (NS_SUCCEEDED(rv = dateLiteral->GetValue( &theDate ))) {		LL_I2L(million, PR_USEC_PER_SEC);		LL_DIV(theDate, theDate, million);			// convert from microseconds (PRTime) to seconds		PRInt32		now32;		LL_L2I(now32, theDate);		aResult.Truncate();        	aResult.Append(now32, 10);        }        NS_RELEASE(dateLiteral);    }    else if (NS_SUCCEEDED(rv = aNode->QueryInterface(kIRDFIntIID, (void**) &intLiteral))) {	PRInt32		theInt;	aResult.Truncate();        if (NS_SUCCEEDED(rv = intLiteral->GetValue( &theInt ))) {        	aResult.Append(theInt, 10);        }        NS_RELEASE(intLiteral);    }    else if (NS_SUCCEEDED(rv = aNode->QueryInterface(kIRDFLiteralIID, (void**) &literal))) {        nsXPIDLString p;        if (NS_SUCCEEDED(rv = literal->GetValue( getter_Copies(p) ))) {            aResult = p;        }        NS_RELEASE(literal);    }    else {        NS_ERROR("not a resource or a literal");        rv = NS_ERROR_UNEXPECTED;    }    return rv;}