}  if (NS_FAILED(rv = rdf_ContainerAppendElement(mDataSource, aContainer, bookmark))) { NS_ERROR("unable to add bookmark to container"); return rv;
BookmarkParser::AddBookmark(nsIRDFResource * aContainer, const char *url, const char *optionalTitle,		PRInt32 addDate, PRInt32 lastVisitDate, PRInt32 lastModifiedDate, const char *shortcutURL){	nsresult rv;	nsCOMPtr<nsIRDFResource> bookmark;	if (NS_FAILED(rv = gRDFService->GetResource(url, getter_AddRefs(bookmark) )))	{		NS_ERROR("unable to get bookmark resource");		return rv;	}	rv = mDataSource->Assert(bookmark, kRDF_type, kNC_Bookmark, PR_TRUE);    if (rv != NS_RDF_ASSERTION_ACCEPTED)    {		NS_ERROR("unable to add bookmark to data source");		return rv;	}	if ((nsnull != optionalTitle) && (*optionalTitle != '\0'))	{		nsCOMPtr<nsIRDFLiteral> literal;		if (NS_FAILED(rv = gRDFService->GetLiteral(nsAutoString(optionalTitle), getter_AddRefs(literal))))		{			NS_ERROR("unable to create literal for bookmark name");			return rv;		}		rv = mDataSource->Assert(bookmark, kNC_Name, literal, PR_TRUE);        if (rv != NS_RDF_ASSERTION_ACCEPTED)		{			NS_ERROR("unable to set bookmark name");			return rv;		}	}	if (NS_FAILED(rv = rdf_ContainerAppendElement(mDataSource, aContainer, bookmark)))	{		NS_ERROR("unable to add bookmark to container");		return rv;	}	AssertTime(bookmark, kNC_BookmarkAddDate, addDate);	AssertTime(bookmark, kWEB_LastVisitDate, lastVisitDate);	AssertTime(bookmark, kWEB_LastModifiedDate, lastModifiedDate);	if ((nsnull != shortcutURL) && (*shortcutURL != '\0'))	{		nsCOMPtr<nsIRDFLiteral> shortcutLiteral;		if (NS_FAILED(rv = gRDFService->GetLiteral(nsAutoString(shortcutURL),			getter_AddRefs(shortcutLiteral))))		{			NS_ERROR("unable to get literal for bookmark shortcut URL");			return(rv);		}		if (rv != NS_RDF_NO_VALUE)		{			rv = mDataSource->Assert(bookmark,                                     kNC_ShortcutURL,                                     shortcutLiteral,                                     PR_TRUE);            if (rv != NS_RDF_ASSERTION_ACCEPTED)			{				NS_ERROR("unable to set bookmark shortcut URL");				return(rv);			}		}	}	return(NS_OK);}