I was already debugging the library the way you suggested [verbosity and adding extra prints inside the code].
Eventually now it is working. There were following issues.
1. Potential libnetconf bug, where it was not updating datastores external model tree for transAPI.
diff --git a/src/datastore.c b/src/datastore.c
index f611130..a752a6a 100644
--- a/src/datastore.c
+++ b/src/datastore.c
@@ -5235,6 +5235,10 @@ static nc_reply* ncds_apply_transapi(struct ncds_ds* ds, const struct nc_session
/* announce error-option to the TransAPI module, if error-option not set, announce default stop-on-error */
for (tapi_iter = ds->transapis; tapi_iter != NULL; tapi_iter = tapi_iter->next) {
*(tapi_iter->tapi->erropt) = (erropt != NC_EDIT_ERROPT_NOTSET) ? erropt : NC_EDIT_ERROPT_STOP;
+ if ((ds->ext_model_tree = yinmodel_parse(ds->ext_model, tapi_iter->tapi->ns_mapping)) == NULL) {
+ return EXIT_FAILURE;
+ }
+
}
/* add default values */
2. libnetconf : replacing the namespace in the callback paths [callbacks[i].path] with "A" using a default NS pair structure.
struct ns_pair ext_ns_mapping[MAPPING_SIZE] = {
{"A",NULL},{"B",NULL},{"C",NULL},{"D",NULL},{"E",NULL},{"F",NULL},
{"G",NULL},{"H",NULL},{"I",NULL},{"J",NULL},{"K",NULL},{"L",NULL},{"M",NULL},
{"N",NULL},{"O",NULL},{"P",NULL},{"Q",NULL},{"R",NULL},{"S",NULL},{"T",NULL},
{"U",NULL},{"V",NULL},{"W",NULL},{"X",NULL},{"Y",NULL},{"Z",NULL},{NULL,NULL},};
3. Earlier the XML file I was generating had namespace issues, however, in the last example I sent, it was correct.
Hope this helps anyone using the lib.
Thanks for all your help.
Thanks
Chandan