goto done;  if (rv == NS_RDF_NO_VALUE)
rdf_ContainerGetNextValue(nsIRDFDataSource* ds,                          nsIRDFResource* container,                          nsIRDFResource** result){    NS_ASSERTION(ds,        "null ptr");    NS_ASSERTION(container, "null ptr");    nsresult rv;    if (NS_FAILED(rv = rdf_EnsureRDFService()))        return rv;    nsIRDFNode* nextValNode       = nsnull;    nsIRDFLiteral* nextValLiteral = nsnull;    nsXPIDLString s;    nsAutoString nextValStr;    PRInt32 nextVal;    PRInt32 err;    // Get the next value, which hangs off of the bag via the    // RDF:nextVal property.    if (NS_FAILED(rv = ds->GetTarget(container, kRDF_nextVal, PR_TRUE, &nextValNode)))        goto done;    if (NS_FAILED(rv = nextValNode->QueryInterface(kIRDFLiteralIID, (void**) &nextValLiteral)))        goto done;    if (NS_FAILED(rv = nextValLiteral->GetValue( getter_Copies(s) )))        goto done;    nextValStr = (const PRUnichar*) s;    nextVal = nextValStr.ToInteger(&err);    if (NS_FAILED(err))        goto done;    // Generate a URI that we can return.    nextValStr = kRDFNameSpaceURI;    nextValStr.Append("_");    nextValStr.Append(nextVal, 10);    if (NS_FAILED(rv = gRDFService->GetUnicodeResource(nextValStr, result)))        goto done;    // Now increment the RDF:nextVal property.    if (NS_FAILED(rv = ds->Unassert(container, kRDF_nextVal, nextValLiteral)))        goto done;    NS_RELEASE(nextValLiteral);    ++nextVal;    nextValStr.Truncate();    nextValStr.Append(nextVal, 10);    if (NS_FAILED(rv = gRDFService->GetLiteral(nextValStr, &nextValLiteral)))        goto done;    if (NS_FAILED(rv = rdf_Assert(ds, container, kRDF_nextVal, nextValLiteral)))        goto done;done:    NS_IF_RELEASE(nextValLiteral);    NS_IF_RELEASE(nextValNode);    return rv;}