kNC_Name, true,
kNC_Name, PR_TRUE,
void rdf_recursiveResourceTraversal(nsCOMPtr<nsIRDFResource> currentResource){    nsresult rv;    PRBool result;    const PRUnichar *textForNode = NULL;    nsCOMPtr<nsISupports> supportsResult;    nsCOMPtr<nsIRDFNode> node;    nsCOMPtr<nsIRDFLiteral> literal;    nsCOMPtr<nsIRDFResource> childResource;    nsCOMPtr<nsIRDFContainer> container;    nsCOMPtr<nsISimpleEnumerator> elements;            // ASSERT(NULL != gRDFCU)    rv = gRDFCU->IsContainer(gBookmarksDataSource, currentResource,                              &result);    if (result) {        // It's a folder                printf("FOLDER:\n");        rdf_printArcLabels(currentResource);        // see if it has a name target        rv = gBookmarksDataSource->GetTarget(currentResource,                                                    kNC_Name, true,                                                     getter_AddRefs(node));                if (NS_SUCCEEDED(rv)) {            // if so, make sure it's an nsIRDFLiteral            rv = node->QueryInterface(NS_GET_IID(nsIRDFLiteral),                                       getter_AddRefs(literal));            if (NS_SUCCEEDED(rv)) {                rv = literal->GetValueConst(&textForNode);                printf("folder: %S\n", textForNode);            }            else {                printf("recursiveResourceTraversal: node is not an nsIRDFLiteral.\n");            }                    }         else {            printf("recursiveResourceTraversal: can't get name from currentResource.\n");        }                    // get a container in order to recurr        rv = nsComponentManager::CreateInstance(NS_IRDFCONTAINER_PROGID,                                                nsnull,                                                NS_GET_IID(nsIRDFContainer),                                                getter_AddRefs(container));        if (NS_FAILED(rv)) {            printf("recursiveResourceTraversal: can't get a new container\n");            return;        }                rv = container->Init(gBookmarksDataSource, currentResource);        if (NS_FAILED(rv)) {            printf("recursiveResourceTraversal: can't init container\n");            return;        }                // go over my children        rv = container->GetElements(getter_AddRefs(elements));        if (NS_FAILED(rv)) {            printf("recursiveResourceTraversal: can't get elements from folder\n");            return;        }        rv = elements->HasMoreElements(&result);        if (NS_FAILED(rv)) {            printf("recursiveResourceTraversal: folder %s has no children.\n",                   textForNode);             return;        }        while (result) {            rv = elements->GetNext(getter_AddRefs(supportsResult));            if (NS_FAILED(rv)) {                printf("Exception: Can't get next from enumerator.\n");                return;            }            // make sure it's an RDFResource            rv = supportsResult->QueryInterface(NS_GET_IID(nsIRDFResource),                                                 getter_AddRefs(childResource));            if (NS_FAILED(rv)) {                printf("Exception: next from enumerator is not an nsIRDFResource.\n");                return;            }            rdf_recursiveResourceTraversal(childResource);            rv = elements->HasMoreElements(&result);            if (NS_FAILED(rv)) {                printf("Exception: can't tell if we have more elements.\n");                 return;            }        }    }    else {        // It's a bookmark        printf("BOOKMARK:\n");        rdf_printArcLabels(currentResource);        // see if it has a URL target        rv = gBookmarksDataSource->GetTarget(currentResource,                                                    kNC_URL, true,                                                     getter_AddRefs(node));        if (NS_FAILED(rv)) {            printf("recursiveResourceTraversal: can't get url from currentResource\n");            return;        }                // if so, make sure it's an nsIRDFLiteral        rv = node->QueryInterface(NS_GET_IID(nsIRDFLiteral),                                   getter_AddRefs(literal));        if (NS_FAILED(rv)) {            printf("recursiveResourceTraversal: node is not an nsIRDFLiteral.\n");            return;        }        // get the value of the literal        rv = literal->GetValueConst(&textForNode);        if (NS_FAILED(rv)) {            printf("recursiveResourceTraversal: node doesn't have a value.\n");            return;        }        printf("\turl: %S\n", textForNode);            }    }